How rvbyy/a1-libi works
A1Libi is a local AI assistant built on GalèreLM, with a CLI and a documented Gradio web interface. In the principal workflow, a user starts a session and submits a prompt; the engine applies intent checks, builds a prompt using short- and long-term memory and available tools, calls local Ollama, executes requested tools, and persists the conversation. The README also documents anti-hallucination retries and configuration-based model selection. Source evidence is partial, so edges for unsampled integrations and web wiring are omitted where their callers are not established.
Main entry points: main.py CLI application · engine.py Chat engine · repl.py Chat REPL · rag.py Long-term memory RAG
Components 23
User interfaces
- CLI application
src/main.py - Chat REPL
src/repl.py - Web interface
src/webapp - CLI commands
src/commands
Conversation engine
- Chat engine
src/galerelm/engine.py - Intent guardrail
src/galerelm/intent_classifier.py - Anti-hallucination graph
src/galerelm/graph.py - Prompt construction
src/galerelm/models/prompt.py - Chat and messages
src/galerelm/models/chat.py
Session and memory
- Session and profiles
src/galerelm/session_manager.py - Database
src/galerelm/database.py - Conversation context
src/galerelm/models/context.py - Long-term memory RAG
src/galerelm/rag.py - Long-term memory models
src/galerelm/models/deep_context.py
Tools and scheduling
- Tool registry and executor
src/tools/registry.py - Tool contract
src/tools/ITools.py - Built-in tool sets
src/tools - Scheduled task manager
src/scheduler/task_manager.py - Task runner
src/scheduler/runner.py
Model integration
- Configuration
src/config.py - Ollama HTTP client
src/rapideAPI/client.py
Other components
- User
- Ollama service
Connections 30
- User → CLI application: starts chat
- User → Web interface: uses interface
- CLI application → Chat engine: assembles
src/main.py - CLI application → Session and profiles: loads profile
src/main.py - CLI application → Database: initializes
src/main.py - CLI application → Chat REPL: starts
src/main.py - Chat REPL → CLI commands: dispatches
src/repl.py - Chat REPL → Chat engine: streams chat
src/repl.py - CLI application → Intent guardrail: configures
src/main.py - CLI application → Anti-hallucination graph: enables
src/main.py - Chat engine → Intent guardrail: classifies prompt
src/galerelm/engine.py - Chat engine → Anti-hallucination graph: runs workflow
src/galerelm/engine.py - Chat engine → Prompt construction: builds prompt
src/galerelm/engine.py - Chat engine → Chat and messages: prepares chat
src/galerelm/engine.py - Chat engine → Tool registry and executor: executes tool calls
src/galerelm/engine.py - Chat engine → Conversation context: updates conversation
src/galerelm/engine.py - Chat engine → Ollama HTTP client: requests model
src/galerelm/engine.py - Prompt construction → Long-term memory RAG: uses memories
- Long-term memory models → Long-term memory RAG: delegates search
src/galerelm/models/deep_context.py - Long-term memory RAG → Long-term memory models: archives memories
src/galerelm/models/deep_context.py - Session and profiles → Database: persists sessions
- CLI application → Scheduled task manager: creates
src/main.py - CLI application → Task runner: starts
src/main.py - Task runner → Scheduled task manager: gets due tasks
src/scheduler/runner.py - Scheduled task manager → Database: persists tasks
src/scheduler/task_manager.py - Tool registry and executor → Tool contract: executes implementations
src/tools/registry.py - Built-in tool sets → Tool contract: implements
src/tools/registry.py - Configuration → CLI application: configures startup
src/main.py - Ollama HTTP client → Ollama service: sends HTTP requests
- Web interface → Chat engine: serves chat