How vatsmanu728/avaranam-agent works
Avaranam Agent is a conversational planning CLI that chooses whether to retrieve scam-related knowledge, ask a clarifying question, escalate, or produce an answer. A chat loads prior conversation state, runs a bounded LangGraph planning cycle, and saves the updated state for later invocations. Decisions use Gemini; retrieval and final judgment are wired to the separate knowledge and core packages. The graph and state contract implement the planning layer. The README and excerpts support the main wiring; external package internals are not shown.
Main entry points: graph.py Planning graph · cli.py Chat CLI · persistence.py State persistence · decision.py Action decision
Components 17
Planning workflow
- Agent state
src/avaranam_agent/state.py - Action set
src/avaranam_agent/actions.py - Planning graph
src/avaranam_agent/graph.py - Action decision
src/avaranam_agent/decision.py - Knowledge search stage
src/avaranam_agent/graph.py - Clarification stage
src/avaranam_agent/graph.py - Answer stage
src/avaranam_agent/graph.py - Escalation stage
src/avaranam_agent/graph.py
Conversation memory
- State persistence
src/avaranam_agent/persistence.py - Saved conversation
src/avaranam_agent/persistence.py
External capabilities
- Gemini API
- Knowledge package
- Core judgment package
Other components
- User
- Human reviewer
Connections 20
- User → Chat CLI: sends message
README.md - Chat CLI → Settings: loads settings
src/avaranam_agent/cli.py - Chat CLI → State persistence: loads and saves
src/avaranam_agent/cli.py - State persistence → Saved conversation: reads and writes
src/avaranam_agent/persistence.py - State persistence → Agent state: builds state
src/avaranam_agent/persistence.py - Chat CLI → Planning graph: runs cycle
src/avaranam_agent/cli.py - Chat CLI → Action decision: wires decision
src/avaranam_agent/cli.py - Planning graph → Agent state: reads and updates
src/avaranam_agent/graph.py - Planning graph → Action set: routes actions
src/avaranam_agent/graph.py - Planning graph → Action decision: requests action
README.md - Action decision → Gemini API: requests decision
src/avaranam_agent/decision.py - Planning graph → Knowledge search stage: routes search
README.md - Knowledge search stage → Knowledge package: searches knowledge
- Knowledge search stage → Planning graph: returns to decide
README.md - Planning graph → Clarification stage: routes clarification
README.md - Planning graph → Answer stage: routes answer
README.md - Answer stage → Core judgment package: requests judgment
- Planning graph → Escalation stage: routes escalation
README.md - Escalation stage → Human reviewer: escalates for review
README.md - Chat CLI → User: shows result
src/avaranam_agent/cli.py