CogniVault is a secure, scalable Retrieval-Augmented Generation (RAG) platform designed for enterprise knowledge management. It allows organizations to ingest proprietary documentation (PDFs) and enables employees to query that data using Natural Language, ensuring answers are strictly grounded in internal policies.
CogniVault follows a modular Service-Repository pattern to separate business logic from API handling, ensuring scalability and maintainability.
The Workflow:
- Ingestion: PDFs are uploaded, text is extracted and split into chunks (1000 tokens).
- Embedding: Text chunks are converted to vector embeddings using OpenAI models.
- Storage: Vectors are stored locally in ChromaDB (Vector Store).
- Retrieval: User queries are embedded, and a cosine similarity search finds the top 3 relevant chunks.
- Generation: The LLM generates a factual answer based only on the retrieved context.
This project follows industry-standard directory layout:
enterprise_project/
├── app/
│ ├── api/ # API Controllers (FastAPI Routes)
│ ├── core/ # Configuration & Secrets Management
│ ├── schemas/ # Pydantic Models for Data Validation
│ └── services/ # Business Logic (Ingestion & RAG)
├── data/ # Persisted Vector Database (ChromaDB)
├── docs/ # Architecture & API Documentation
├── Dockerfile # Containerization instructions
└── requirements.txt # Python Dependencies
- Python 3.10+
- OpenAI API Key
Clone the repository and install dependencies:
git clone [https://github.com/hq969/cognivault.git](https://github.com/your-username/cognivault.git)
cd cognivault
pip install -r requirements.txt
Create a .env file in the root directory:
OPENAI_API_KEY=sk-proj-your-api-key-here
Start the server using Uvicorn:
uvicorn app.main:app --reload
The API will be available at: http://localhost:8000
You can interact with the API via the built-in Swagger UI at http://localhost:8000/docs.
- Endpoint:
POST /api/v1/upload - Description: Indexes a PDF file into the knowledge base.
- Input: Multipart/Form-Data (PDF File)
- Endpoint:
POST /api/v1/query - Description: Ask a question based on uploaded documents.
- Input:
{
"question": "What is the severance policy mentioned in the handbook?"
}
- Response:
{
"answer": "According to the handbook, severance is calculated based on...",
"sources": ["Employee_Handbook_2024.pdf"]
}
To run CogniVault in a containerized production environment:
# Build the image
docker build -t cognivault .
# Run the container
docker run -p 80:80 cognivault
- Hybrid Search: Combining Keyword search with Vector search for better accuracy.
- Role-Based Access Control (RBAC): Restricting document access by user level.
- Frontend UI: A React/Streamlit dashboard for non-technical users.
Developed for Enterprise AI Solutions.