Skip to content

Latest commit

 

History

1,427 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Klea logo

Klea

Knowledge vaLidated Expert AI Assistant for scientific research.

Grounded, citation-backed answers over your own research sources.

GitHub CI License: MIT GitHub pull requests GitHub issues GitHub Org's stars Twitter Follow Gitter

All Contributors

This repository contains multiple packages that together make up the AI assistant, Klea.

Why Klea

Klea is a research assistant that grounds its answers in your own sources. Queries are answered from domain-configurable knowledge stores (documents, papers, databases) rather than the model's memory alone: answers are checked by an evaluation loop, cite the documents they drew on, and record their provenance so researchers can inspect and verify the output. When a query cannot be grounded in the available sources, Klea flags the fallback rather than presenting it as confident fact.

On top of that grounded retrieval core sits a general-purpose research agent for the research lifecycle -- literature review, hypothesis generation, planning, coding, pipeline execution, and analysis. Because capabilities are supplied by MCP tools and domain-configurable knowledge stores rather than hard-coded, the same assistant extends to new research tasks as tools are added. That focus on grounded, cited answers is what sets Klea apart from general-purpose chat and coding assistants.

Status: the RAG pipeline (klea_rag / klea_utils) is ready to use today. The agent (klea_agent) is under active development, with an initial release planned.

Features

Retrieval (RAG)

  • Multi-domain knowledge stores with automatic query classification and routing
  • Grounded answers -- retrieval plus an evaluation loop, with every response recording the sources and tools it drew on
  • Hybrid retrieval combining dense vector search and BM25 keyword search, fused with Reciprocal Rank Fusion and a recency tiebreaker
  • Pluggable vector stores: Chroma, Qdrant, and PGVector
  • Document ingestion via Docling with OCR, automatic bibliographic metadata extraction (DOI resolution through Crossref, OpenAlex, and Semantic Scholar), and domain-scoped metadata filters

Agent (work in progress)

  • General-purpose research agent for literature review, hypothesis generation, planning, coding, pipeline execution, and analysis
  • General and Scientific operating modes, with chat-versus-task routing and a planner -- Scientific mode awaits a curated knowledge source
  • A human plan-review step, currently auto-approved; interactive pause/resume is pending
  • Capabilities supplied by MCP tools rather than hard-coded, so the agent extends as tools are added
  • Tool access levels (read_only / full) and sandboxed command execution with a wall-clock backstop

Interfaces and models

  • CLI, FastAPI server, NiceGUI web UI, Streamlit, and TUI
  • Bring-your-own LLM: OpenAI-compatible, Anthropic, HuggingFace, and custom endpoints, with runtime model switching and prompt caching
  • NeuroML MCP tools: model validation, OSB and NeuroML-DB lookups, web search, and sandboxed code execution

The packages included, one in each folder are:

  • agent_pkg: the main Klea agent, a general-purpose research agent (coding, workflows, analysis, hypothesis generation)
  • rag_pkg: a generic RAG implementation, primarily consumed by the agent
  • mcp_pkg: MCP server for NeuroML
  • utils_pkg: common utility functions used by other packages

Please see the individual Readme files for more information.

Funding

Klea is funded by the BioFAIR Pathfinder Projects grant "Creating AI-enabled analysis pipelines for FAIR neuroscience data", awarded to Padraig Gleeson and Ankur Sinha at University College London.

As part of this Pathfinder project, Klea is being tested for neuroscience research, through the NeuroML-specific nml-mcp server and the curated NeuroML vector stores.

BioFAIR logo

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Ankur Sinha
Ankur Sinha

💻 📖 🐛 📝 🔣 🎨 💡 💵 🤔 🚇 🚧 📣 📆 🔬 👀 🛡️ ⚠️ ✅
Padraig Gleeson
Padraig Gleeson

💻 📖 🐛 💵 🤔 🚇 🚧 📣 📆 🔬 👀 🛡️ ⚠️ ✅
Khanak Khandelwal
Khanak Khandelwal

💻 🎨 🤔 🔬 📖
Dhanush Shankar
Dhanush Shankar

💻
Dhanush Shankar
Dhanush Shankar

💻
Add your contributions

This project follows the all-contributors specification. Contributions of any kind welcome!

License

Klea is released under the MIT License. See LICENSE for the full text. Copyright (c) 2025 The Klea authors.

About

KLEA: Knowledge vaLidated Expert AI assistant for science/research

Topics

Resources

Contributing

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages