A Retrieval Augmented Generation (RAG) system for intelligent document Q&A with persistent conversation memory.
- Document Ingestion: Upload and process PDF, TXT, and Markdown files
- Semantic Search: ChromaDB-powered vector search with local embeddings
- Conversational AI: Multi-turn conversations powered by Claude LLM
- Persistent Memory: SQLite-backed conversation history with automatic summarization
- Source Attribution: Tracks which documents informed each response
# Clone the repository
git clone https://github.com/JDKrasnick/Recollect.git
cd Recollect
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env and add your Anthropic API keyRequired environment variables in .env:
| Variable | Description | Default |
|---|---|---|
ANTHROPIC_API_KEY |
Your Anthropic API key (required) | - |
CLAUDE_MODEL |
Claude model to use | claude-sonnet-4-20250514 |
CHUNK_SIZE |
Document chunk size in characters | 1000 |
CHUNK_OVERLAP |
Overlap between chunks | 200 |
MAX_CONTEXT_CHUNKS |
Max chunks to include in context | 5 |
SIMILARITY_THRESHOLD |
Minimum similarity for search results | 0.7 |
from app.main import Recollect
# Initialize the system
rag = Recollect()
# Add documents
doc_id = rag.add_document("path/to/document.pdf")
# Query your documents
response = rag.query("What does the document say about X?")
print(response.content)
print(response.sources) # See which documents were used
# Search without generating a response
results = rag.search("keyword", top_k=5)
# List all documents
documents = rag.list_documents()
# Get system stats
stats = rag.stats()
# Clean up
rag.close()app/
├── main.py # Recollect class - main public API
├── config.py # Pydantic settings configuration
├── models/
│ └── schemas.py # Data models and schemas
└── services/
├── document_processor.py # PDF/text extraction and chunking
├── vector_store.py # ChromaDB vector database
├── rag_engine.py # Retrieval + generation pipeline
└── conversation_memory.py # SQLite conversation storage
- LLM: Anthropic Claude API
- Vector Store: ChromaDB with local Sentence Transformers embeddings
- Document Processing: PyPDF for PDFs
- Data Storage: SQLite for conversations, ChromaDB for vectors
- Validation: Pydantic
# Run tests
pytest tests/
# Format code
black app/ tests/
# Lint
ruff check app/ tests/MIT