How abhinav-code-cloud/mini-chatgpt works
MyBolt is a small conversational agent with a terminal interaction loop: a user message reaches the agent, which requests an LLM reply, saves the exchange, and returns the reply. A separate FastAPI WebSocket endpoint echoes received text with an acknowledgement; the shown code does not route WebSocket messages through the agent. The source excerpts establish these paths, but provide no evidence of shared state or integration between the two entry points.
Main entry points: agent.py Message Handler · main.py Terminal Loop · llm.py LLM Client · memory.py Memory Writer
Components 9
Terminal Agent
- Terminal Loop
main.py - Message Handler
agents/agent1/agent.py
Agent Services
- LLM Client
llm.py - Memory Writer
memstore/memory.py - Conversation Memory
memstore/memory.json
WebSocket
- WebSocket Endpoint
gateway.py
Other components
- Terminal User
- OpenAI API
- WebSocket Client
Connections 8
- Terminal User → Terminal Loop: enters message
main.py - Terminal Loop → Message Handler: calls handler
main.py - Message Handler → LLM Client: requests reply
agents/agent1/agent.py - LLM Client → OpenAI API: calls chat API
llm.py - Message Handler → Memory Writer: saves exchange
agents/agent1/agent.py - Memory Writer → Conversation Memory: reads and writes
memstore/memory.py - WebSocket Client → WebSocket Endpoint: sends text
gateway.py - WebSocket Endpoint → WebSocket Client: sends acknowledgement
gateway.py