How lahirusandeepa-lk/ai-assistent works
ABC Bank’s fictional enterprise assistant serves public banking questions with retrieval-grounded, cited answers. A chat request passes through the public UI and API, which handles identity, authorization, rate and token limits before invoking the LangGraph orchestrator. The agent routes the request, retrieves knowledge, calls tools or the model gateway, and returns a guarded answer with citations and usage. Admins upload and index documents and manage model configuration. The README documents the service boundaries; sampled code confirms several library-level calls, but not every service’s internal wiring.
Main entry points: app/main.py Assistant API · ops.py Agent operations · provider.py Provider selection · app/main.py Admin backend
Components 27
User experience and edge
- Public chat UI
services/ui-public/app.py - Assistant API
services/ai-assistant-api/app/main.py - Keycloak OIDC
- Role authorization
libs/authz/rbac.py
Agent runtime
- Orchestrator service
services/ai-orchestrator/app/main.py - Agent graph
libs/orchestrator/graph.py - Agent operations
libs/orchestrator/ops.py - Input and output guardrails
libs/orchestrator/guardrails.py - Tool service
services/ai-tool-service/app/main.py - Tool runtime
libs/orchestrator/tools.py
Knowledge management
- Retrieval service
services/ai-knowledge-service/retrieval/app/main.py - Hybrid knowledge index
libs/rag/store.py - Ingestion service
services/ai-knowledge-service/ingestion/app/main.py - Document ingestion
libs/rag/ingest.py
Models and state
- Model gateway
libs/llm/gateway.py - Provider selection
libs/llm/provider.py - Conversation memory
libs/memory/conversation.py - Token budgets
libs/memory/usage.py - Redis
- Postgres
- Google Gemini
- OpenAI fallback
Administration
- Upload job runner
libs/admin/ingest_runner.py - Admin backend
services/ai-admin-service/app/main.py - Ingestion jobs
libs/admin/jobs.py - LLM configuration
libs/llm/config_store.py
Other components
- Chat user
Connections 29
- Chat user → Public chat UI: asks question
- Public chat UI → Assistant API: sends chat
- Assistant API → Keycloak OIDC: verifies identity
- Assistant API → Role authorization: checks roles
services/ai-assistant-api/app/main.py - Assistant API → Token budgets: checks token budget
services/ai-assistant-api/app/main.py - Assistant API → Orchestrator service: runs agent
- Orchestrator service → Agent graph: invokes graph
services/ai-orchestrator/app/main.py - Agent graph → Agent operations: dispatches operations
libs/orchestrator/graph.py - Agent graph → Input and output guardrails: applies guardrails
libs/orchestrator/graph.py - Agent operations → Retrieval service: searches knowledge
- Agent operations → Model gateway: requests completion
libs/orchestrator/ops.py - Agent operations → Conversation memory: uses session memory
libs/orchestrator/ops.py - Agent operations → Tool service: calls tools
- Tool service → Tool runtime: dispatches tools
services/ai-tool-service/app/main.py - Retrieval service → Hybrid knowledge index: searches index
services/ai-knowledge-service/retrieval/app/main.py - Ingestion service → Document ingestion: ingests documents
services/ai-knowledge-service/ingestion/app/main.py - Document ingestion → Hybrid knowledge index: writes chunks
libs/rag/ingest.py - Admin backend → Document ingestion: indexes text
services/ai-admin-service/app/main.py - Admin backend → Upload job runner: starts upload job
services/ai-admin-service/app/main.py - Upload job runner → Hybrid knowledge index: upserts chunks
libs/admin/ingest_runner.py - Upload job runner → Ingestion jobs: updates progress
libs/admin/ingest_runner.py - Admin backend → LLM configuration: manages providers
services/ai-admin-service/app/main.py - Model gateway → Provider selection: selects providers
libs/llm/gateway.py - Model gateway → Token budgets: meters tokens
libs/llm/gateway.py - Provider selection → LLM configuration: reads settings
libs/llm/provider.py - Provider selection → Google Gemini: calls primary
- Provider selection → OpenAI fallback: fails over
- Token budgets → Redis: stores counters
libs/memory/usage.py - Conversation memory → Postgres: persists history
libs/memory/conversation.py