How codinghub27/ai_assistant works
AI Research Assistant is a Django application where authenticated users submit questions, receive agent-produced answers with source links, and can review or clear saved research history. The research view loads recent conversation context, invokes the LangChain agent, extracts sources, and stores the result. Documented agent tools cover web search, page reading, Wikipedia summaries, and text summarization. The README also describes JWT-protected APIs and template-based pages. Agent, model, and routing details are represented from the README and tree where their source was not sampled.
Main entry points: views.py Research API · agent.py ReAct Agent · models.py Saved Queries · urls.py Research Routes
Components 23
Research Workflow
- Research API
agent/views.py - ReAct Agent
agent/agent.py - Source Extraction
agent/views.py - History API
agent/views.py - Delete History
agent/views.py - Research Routes
agent/urls.py - Project Routing
research/urls.py
Research Tools
- Web Search
agent/tools.py - Page Reader
agent/tools.py - Wikipedia Lookup
agent/tools.py - Text Summarizer
agent/tools.py
History Storage
- Research Sessions
agent/models.py - Saved Queries
agent/models.py
Accounts and UI
- Account Views
users/views.py - Login Routes
users/urls.py - Chat and History UI
agent/templates/agent - Account UI
users/templates/users
Other components
- User
- Tavily
- Web Pages
- Wikipedia API
- Groq LLM
- PostgreSQL
Connections 33
- User → Research API: submits question
- Research API → Research Sessions: gets session
- Research API → Saved Queries: loads context
- Research API → ReAct Agent: invokes agent
- ReAct Agent → Web Search: calls tool
- ReAct Agent → Page Reader: calls tool
- ReAct Agent → Wikipedia Lookup: calls tool
- ReAct Agent → Text Summarizer: calls tool
- Web Search → Tavily: searches
- Page Reader → Web Pages: fetches content
- Wikipedia Lookup → Wikipedia API: requests summary
- Text Summarizer → Groq LLM: summarizes text
- Research API → Source Extraction: extracts sources
- Research API → Saved Queries: saves answer
- Research API → User: returns answer
- History API → Research Sessions: finds session
- History API → Saved Queries: reads history
- Delete History → Research Sessions: finds session
- Delete History → Saved Queries: deletes queries
- User → History API: requests history
- User → Delete History: clears history
- User → Login Routes: opens account
- Login Routes → Account Views: dispatches
- User → Research Routes: opens research
- Research Routes → Research API: dispatches
- Project Routing → Research Routes: includes routes
- Project Routing → Login Routes: includes routes
- User → Chat and History UI: uses chat
- User → Account UI: uses account pages
- Research API → Chat and History UI: renders pages
- History API → Chat and History UI: renders history
- Research Sessions → PostgreSQL: persists records
- Saved Queries → PostgreSQL: persists records