A Python starter project for a document assistant that can:
- read a PDF
- generate a summary with Claude
- suggest questions with Claude
- answer user questions with Claude using retrieved supporting chunks
- generate local embeddings with Ollama
- Create a virtual environment.
- Install dependencies:
pip install -r requirements.txt
- Add a
.envfile in the project root:ANTHROPIC_API_KEY=your_key_here ANTHROPIC_MODEL=claude-3-5-haiku-latest OLLAMA_BASE_URL=http://localhost:11434 OLLAMA_EMBED_MODEL=mxbai-embed-large
- Make sure Ollama is running and the embedding model is available:
ollama pull mxbai-embed-large
python main.py summarize path/to/file.pdfpython main.py ask path/to/file.pdf "What are the key risks discussed?"python main.py suggest path/to/file.pdf- V1 supports PDF only.
- FAISS is used as the local vector index.
- Traces are saved in
runs/. - Claude is used for summary and question answering via the Messages API.
- Ollama
/api/embedis used for local embedding generation.