Skip to content

ramasamysh/document-summarize-agent

Repository files navigation

Document Agent (Anthropic + Ollama Embeddings)

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

Setup

  1. Create a virtual environment.
  2. Install dependencies:
    pip install -r requirements.txt
  3. Add a .env file 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
  4. Make sure Ollama is running and the embedding model is available:
    ollama pull mxbai-embed-large

Run summary mode

python main.py summarize path/to/file.pdf

Run question-answer mode

python main.py ask path/to/file.pdf "What are the key risks discussed?"

Suggested questions

python main.py suggest path/to/file.pdf

Notes

  • 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/embed is used for local embedding generation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages