prism-agentic-rag
madhavmadupu/prism-agentic-rag
P.R.I.S.M. is a production-grade, multimodal, agentic Retrieval-Augmented Generation (RAG) platform engineered for high-stakes financial intelligence.
Instalação
npx convez-ai madhavmadupu/prism-agentic-rag1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
README
A tradução para o português deste README ainda está na fila.
P.R.I.S.M.
Pipeline for Retrieval, Inference, & Structured Memory
P.R.I.S.M. is a production-grade, multimodal, agentic Retrieval-Augmented Generation (RAG) platform engineered for high-stakes financial intelligence. It integrates Agentic Routing, GraphRAG (Structured Memory), Corrective RAG (CRAG), and Model Context Protocol (MCP) to deliver autonomous, self-correcting, and real-time market insights.
Core Architectural Pillars
| Pillar | Technology | What It Does |
|---|---|---|
| Agentic Orchestration | LangGraph | Dynamically decomposes queries and routes them to the optimal retrieval modality |
| Structured Memory | Neo4j GraphRAG | Multi-hop reasoning across company relationships and executive backgrounds |
| Contextual Retrieval | Pinecone + Cohere Rerank v3 | Hybrid vector search with precision-boosting reranking |
| Truthful Inference | Corrective RAG (CRAG) | Self-reflective verification loop with confidence scoring |
| Multimodal Extraction | GPT-4o Vision | Parses financial charts, tables, and PDF pages |
| Live Data | MCP / Yahoo Finance | Real-time stock prices, P/E ratios, and financial metrics |
| Production Observability | RAGAS + Redis Cache | Automated evaluation + semantic caching for 40% cost reduction |
V1.0 Performance Metrics
| Metric | Industry Baseline | P.R.I.S.M. Target | Status |
|---|---|---|---|
| RAGAS Faithfulness | ~0.75 | > 0.90 | Built |
| RAGAS Context Precision | ~0.70 | > 0.85 | Built |
| Answer Relevancy | ~0.75 | > 0.88 | Built |
| Hallucination Rate | ~15% | < 5% | Built (CRAG loop) |
| P95 Latency | ~4.5s | < 2.5s | Built |
| Cost per Query | ~$0.025 | < $0.015 | Built (Redis cache) |
System Architecture
graph TD
A[Streamlit UI / API] --> B[FastAPI Gateway]
B --> C{Agentic Router<br/>LangGraph}
C -->|Relational| D[Neo4j GraphRAG]
C -->|Semantic| E[Pinecone + Cohere Rerank]
C -->|Real-time| F[Yahoo Finance MCP]
C -->|Visual| G[GPT-4o Vision]
D --> H[Context Aggregator]
E --> H
F --> H
G --> H
H --> I{CRAG Loop<br/>Self-Reflection}
I -->|Confidence < 0.7| C
I -->|Confidence >= 0.7| J[GPT-4o Inference]
J --> K[Guardrails & Citation]
K --> L[Response]
M[RAGAS] -.->|Evaluation| H
N[Redis] -.->|Semantic Cache| B
Quick Start
git clone https://github.com/yourusername/prism-ai.git
cd prism-ai
cp .env.example .env
# Edit .env with your API keys (see docs/setup.md)
# Start all services
docker-compose up --build
# Or run locally
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
uvicorn src.main:app --reload
| Service | URL | Description |
|---|---|---|
| API Docs | http://localhost:8000/docs | Swagger UI |
| Streamlit UI | http://localhost:8501 | Interactive frontend |
| Neo4j Browser | http://localhost:7474 | Graph database UI |
| Redis | redis://localhost:6379 | Semantic cache |
Project Structure
├── src/
│ ├── main.py # FastAPI entry point
│ ├── config.py # Environment config (pydantic-settings)
│ ├── api/ # REST API routes & Pydantic models
│ ├── agents/ # LangGraph state machine & nodes
│ ├── graph/ # Neo4j client, schema, Cypher generator
│ ├── ingestion/ # Chunking, Cohere embeddings, Pinecone ingest
│ ├── retrieval/ # Vector search & Cohere reranking
│ ├── multimodal/ # GPT-4o Vision extraction
│ ├── mcp_servers/ # Yahoo Finance MCP server
│ ├── cache/ # Redis semantic caching
│ ├── evaluation/ # RAGAS metrics & golden dataset
│ └── middleware/ # Rate limiting & input sanitization
├── frontend/
│ └── streamlit_app.py # Interactive query UI
├── docs/ # Architecture & integration docs
├── tests/ # 40+ test cases
├── docker-compose.yml # API + Redis + Neo4j
└── Dockerfile # Multi-stage Python 3.11
Documentation
| Document | Description |
|---|---|
| Setup Guide | Environment config, Docker, local dev |
| Agent Architecture | LangGraph state machine, CRAG loop |
| Graph Schema | Neo4j nodes, relationships, example queries |
| MCP Integration | Yahoo Finance server, tool registration |
| Evaluation | RAGAS metrics, golden dataset, caching |
Tech Stack
| Layer | Technology | Purpose |
|---|---|---|
| Orchestration | LangGraph 0.2+ | Stateful, cyclical agentic workflows |
| Vector Store | Pinecone 5.0+ | Managed low-latency hybrid search |
| Knowledge Graph | Neo4j 5.20+ | Multi-hop entity relationship queries |
| Embeddings | Cohere Embed v3 | Dense vector embeddings |
| Reranking | Cohere Rerank v3 | Precision boost (+20-30%) |
| LLM | GPT-4o | Reasoning, tool-calling, vision |
| Backend | FastAPI / Python 3.11 | High-performance async API |
| Caching | Redis 7 | Semantic similarity caching |
| Evaluation | RAGAS 0.2+ | Faithfulness, precision, recall metrics |
| Frontend | Streamlit 1.38+ | Interactive chat UI |
| Infrastructure | Docker, Compose | Reproducible deployment |
License
MIT License. See LICENSE for details.
P.R.I.S.M. demonstrates the next generation of enterprise AI systems. 16 components, 40+ test cases, 6-phase architecture.