You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NeuralStack — RAG + Agent + MCP on the Anthropic API
A compact, readable reference for agentic retrieval-augmented generation.
Instead of stuffing retrieved text into the prompt up front, retrieval is
exposed to Claude as a tool (search_knowledge_base). The model decides
when to search, can search more than once, and can combine search with other
tools (a calculator here, or any MCP server you attach).
pip install -r requirements.txt
export ANTHROPIC_API_KEY=sk-ant-...
python main.py "How is gratuity calculated in India?"
The ingestion and retrieval half runs with no API key — main.py prints
the passages it would retrieve before any model call, so you can judge
grounding quality for free.
Layout
File
Role
embeddings.py
dependency-free feature-hashing embedder (swap for Voyage AI for real semantics)
vectorstore.py
in-memory cosine top-k store (swap for Chroma/Pinecone at scale)
ingest.py
overlapping-window chunking + document loading
tools.py
tool JSON schemas + safe calculator
mcp_client.py
builds the mcp_servers payload to plug in remote MCP tools
agent.py
the tool-use loop that orchestrates everything
main.py
wiring + a runnable demo over the sample data/ corpus
Adding MCP servers
MCP lets Claude call tools hosted elsewhere (issue trackers, databases,
internal services) without you proxying each call. Attach them in main.py: