Introduction
Cognita is a production-grade, open-source RAG framework built by TrueFoundry. It organizes the RAG pipeline into modular, swappable components — data loaders, parsers, chunkers, embedders, vector stores, retrievers, and generators — so teams can build and iterate on document Q&A systems without rewriting boilerplate code.
What Cognita Does
- Ingests documents from local files, URLs, GitHub repos, and cloud storage
- Parses PDFs, DOCX, HTML, and markdown with configurable chunking strategies
- Embeds text chunks using OpenAI, Cohere, or open-source embedding models
- Stores vectors in Qdrant, Weaviate, or SingleStore for fast similarity search
- Provides a chat interface and REST API for querying knowledge bases with any LLM
Architecture Overview
Cognita follows a modular pipeline architecture with clearly defined interfaces for each stage: DataSource, Parser, Chunker, Embedder, VectorStore, Retriever, and Generator. Each component can be swapped independently. The backend is built with FastAPI, and the frontend uses a React-based UI. An async job queue handles document ingestion and indexing in the background.
Self-Hosting & Configuration
- Deploy with Docker Compose including the backend, frontend, and a vector database
- Configure LLM providers (OpenAI, Anthropic, or local models) via environment variables
- Add custom data sources by implementing the DataSource interface
- Tune chunking parameters (size, overlap, strategy) per collection
- Scale ingestion workers independently from the query serving layer
Key Features
- Modular design lets you swap any pipeline component without changing the rest
- Built-in evaluation tools to measure retrieval quality and answer accuracy
- Supports hybrid search combining dense vectors with keyword-based retrieval
- Multi-collection management with per-collection embedding and chunking configs
- Incremental ingestion avoids re-processing unchanged documents
Comparison with Similar Tools
- LangChain — general LLM framework; Cognita focuses specifically on production RAG pipelines
- LlamaIndex — data framework for LLMs; Cognita adds a managed UI and background job processing
- RAGFlow — deep document understanding; Cognita emphasizes modularity and component swapping
- Haystack — search-oriented AI framework; Cognita provides a ready-to-deploy RAG application
- Verba — Weaviate-specific RAG app; Cognita is vector-store agnostic
FAQ
Q: Which vector databases are supported? A: Qdrant and Weaviate are supported out of the box. Additional stores can be added by implementing the VectorStore interface.
Q: Can I use local LLMs instead of OpenAI? A: Yes. Configure any OpenAI-compatible API endpoint, including Ollama or vLLM, as the generator backend.
Q: How does it handle large document collections? A: Cognita uses background workers for async ingestion and supports incremental updates, making it suitable for collections with thousands of documents.
Q: Is it suitable for production use? A: Yes. Cognita is designed with production deployment in mind, including Docker orchestration, API authentication, and scalable architecture.