How hshaikusa/accountintelligence works
Project type and purpose
• This is an AI-powered account intelligence system written in Python.
• Purpose: Automate research on client companies by ingesting documents (RAG Dataset), querying via a chat interface, and using auxiliary tools (e.g., calculator).
File structure (three levels deep)
Level 1 (top-level):
• AgenticFrameWork.pdf (documentation)
• README.md
• account_intelligence/
• run.py
Level 2 (inside account_intelligence):
• RAG Dataset/
• account_intelligence_ai/
Level 3 (inside account_intelligence_ai):
• app.py (API entrypoint)
• core/
• iteration1/
• tools/
– core/chat_interface.py
– iteration1/factory.py, part1.py, part2.py, part3.py, prompts.py
– tools/calculator.py
README for additional insights
• Streams company reports into a RAG-backed retrieval system.
• Exposes a chat interface that synthesizes data via an LLM.
• Uses “tools” to perform auxiliary tasks (e.g., on-the-fly calculations).
Main components & their relationships
a. User & Client Applications
– Web or CLI client (external actor)
– Connects over HTTP/gRPC to the API layer in app.py
b. API Layer (app.py + run.py)
– Receives queries
– Routes requests to the Core service
c. Core Service (core/chat_interface.py)
– Orchestrates RAG retrieval, prompt assembly, LLM calls
– Uses iteration1 modules for modular prompt design
d. RAG Data Store (account_intelligence/RAG Dataset)
– Contains PDFs indexed by a vector store (external or in-process)
e. LLM Service (external, e.g., OpenAI API)
– Consumes prompts, returns completions
f. Tool Execution Service (tools/calculator.py)
– Provides deterministic operations plugged into the chat pipeline
Architectural patterns & principles
– Layered architecture (API → Core → Data / External Services)
– Modular “iteration1” pattern enabling plug-in prompt factories
– RAG pattern for augmenting LLM responses with retrieved docs
– Separation of concerns: Core logic vs. tool implementations
Essential elements
– Clear component names (app.py, chat_interface, RAG Dataset, calculator)
– Three depth levels of hierarchy
– Callouts for protocols and data formats (PDF ingestion, JSON requests)