Skip to content

JDKrasnick/Recollect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Recollect

A Retrieval Augmented Generation (RAG) system for intelligent document Q&A with persistent conversation memory.

Features

  • 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

Installation

# 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 key

Configuration

Required 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

Usage

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()

Architecture

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

Tech Stack

  • 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

Development

# Run tests
pytest tests/

# Format code
black app/ tests/

# Lint
ruff check app/ tests/

License

MIT

About

Conversational RAG system for document Q&A — ChromaDB retrieval, Claude generation, and persistent SQLite conversation memory with source attribution

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages