Paste a vendor claim or accusation — the agent retrieves evidence from multiple sources and drafts a professional email reply.
Built during the Cognee AI-Memory Hackathon.
Vendor claim
|
v
Qdrant vector search (5 search strategies)
+ Cognee knowledge graph retrieval
|
v
Sentiment analysis (zero-shot via Qdrant)
|
v
LLM drafts email reply with evidence
Search strategies used:
- Semantic search — vector similarity on invoice/transaction chunks
- Entity search — knowledge graph entities (products, vendors, SKUs)
- RRF Fusion — combines broad + vendor-filtered results via Reciprocal Rank Fusion
- Nearest neighbor — similar documents to the top fusion result
- Sentiment classification — embeds claim against anchor phrases per sentiment category (angry, frustrated, neutral, urgent)
- Qdrant — vector store (6 collections, 14k+ vectors)
- Cognee — knowledge graph memory + retrieval
- Ollama — local embeddings (nomic-embed-text, 768d)
- OpenAI or Distil Labs SLM — LLM reasoning
- Streamlit — UI (pixel/retro theme)
Requires a Qdrant instance (cloud or local Docker) with the hackathon snapshot data restored, plus Ollama running locally for embeddings.
# Clone and install
git clone https://github.com/chloepilonv/cognee-reconciliation-agent.git
cd cognee-reconciliation-agent
uv venv && source .venv/bin/activate
uv sync
# Ollama (embeddings)
brew install ollama && ollama serve &
cd models
ollama create nomic-embed-text -f nomic-embed-text/Modelfile
cd ..
# Qdrant (local Docker option)
docker run -d --name qdrant -p 6333:6333 -p 6334:6334 \
-v qdrant_storage:/qdrant/storage qdrant/qdrant
# Restore knowledge graph + vector data
python setup.py
uv run python restore-snapshots.py
# Environment
cp .env.example .env
# Edit .env: fill in QDRANT_URL, QDRANT_API_KEY, optionally OPENAI_API_KEY
# Run
.venv/bin/python -m streamlit run project4-invoice-tracker/app.py| Variable | Required | Description |
|---|---|---|
QDRANT_URL |
yes | Qdrant cluster URL |
QDRANT_API_KEY |
yes | Qdrant API key |
OPENAI_API_KEY |
no | Falls back to local Ollama LLM if not set |
After snapshot restore, Qdrant contains:
| Collection | Records | Content |
|---|---|---|
| DocumentChunk_text | 2,000 | Invoice and transaction chunks |
| Entity_name | 8,816 | Products, vendors, SKUs |
| Sentiment_anchors | 16 | Sentiment classification anchors (auto-created) |
Plus 3 supporting collections (EntityType, EdgeType, TextDocument, TextSummary).
project4-invoice-tracker/
app.py — Streamlit UI + evidence builder
qdrant_helpers.py — all Qdrant interactions (5 search methods + sentiment)
cognee_helpers.py — Cognee knowledge graph retriever
analysis.py — payment analysis (unpaid/late detection)
styles.py — pixel/Minecraft CSS theme
custom_retriever.py — GraphCompletionRetriever (shared)
prompts/ — system + user prompts for LLM