How rishabh-1617/cortex_ai_agent works
Cortex is a local-first research and data assistant. Users submit a question through the terminal or Gradio interface; the agent routes it to deterministic tools, optionally uses a local Ollama model to explain results, and maintains bounded session history. Separate capabilities cover documents, datasets, web research, image/audio/video analysis, and optional GAIA evaluation. Edges follow the shown entry points and README architecture; some internal tool wiring is documented but not visible in the sampled calls.
Main entry points: core.py Request orchestrator · video_analysis.py Video analysis · app.py Gradio interface · image_understanding.py Image understanding
Components 22
User interfaces
- Terminal chat
main.py - Gradio interface
app.py - Uploaded files
uploads
Agent runtime
- Request orchestrator
agent/core.py - Model prompts
agent/prompts.py - Session history
agent/memory.py
Research tools
- Safe calculator
tools/calculator.py - Document reader
tools/document_reader.py - Dataset analysis
tools/data_analysis.py - Web search
tools/web_search.py
Media tools
- Media validation
tools/media_common.py - Image understanding
tools/image_understanding.py - Audio transcription
tools/audio_transcription.py - Subtitle reader
tools/transcript_reader.py - Video analysis
tools/video_analysis.py
GAIA evaluation
- GAIA runner
evaluation/evaluate.py - GAIA API client
evaluation/gaia_client.py
Other components
- User
- Local Ollama
- Search providers
- YouTube metadata API
- GAIA service
Connections 30
- User → Terminal chat: asks
main.py - User → Gradio interface: chats
README.md - Terminal chat → Request orchestrator: submits turn
main.py - Gradio interface → Request orchestrator: processes turn
app.py - Gradio interface → Uploaded files: saves uploads
app.py - Gradio interface → Dataset analysis: analyzes dataset
app.py - Request orchestrator → Safe calculator: evaluates
agent/core.py - Request orchestrator → Document reader: routes requests
README.md - Request orchestrator → Dataset analysis: routes requests
README.md - Request orchestrator → Web search: routes requests
README.md - Request orchestrator → Image understanding: routes requests
README.md - Request orchestrator → Audio transcription: routes requests
README.md - Request orchestrator → Subtitle reader: routes requests
README.md - Request orchestrator → Video analysis: routes requests
README.md - Request orchestrator → Session history: uses history
README.md - Request orchestrator → Model prompts: uses prompts
README.md - Request orchestrator → Local Ollama: requests responses
README.md - Web search → Search providers: searches
README.md - Image understanding → Local Ollama: analyzes locally
README.md - Video analysis → Image understanding: analyzes sampled frames
README.md - Video analysis → Audio transcription: transcribes audio
README.md - Video analysis → YouTube metadata API: fetches metadata
README.md - Image understanding → Media validation: validates files
tools/image_understanding.py - Audio transcription → Media validation: validates files
tools/audio_transcription.py - Subtitle reader → Media validation: validates files
tools/transcript_reader.py - Video analysis → Media validation: validates files
tools/video_analysis.py - User → GAIA runner: requests evaluation
- GAIA runner → Request orchestrator: evaluates answers
README.md - GAIA runner → GAIA API client: fetches and submits
README.md - GAIA API client → GAIA service: calls API
evaluation/gaia_client.py