How eyalaourine/tunisian-administrative-procedures-assistant works
This is a Telegram-facing assistant for Tunisian administrative procedures. Its principal workflow is: a user asks a question or uploads a form; the bridge forwards it through n8n to FastAPI; agents route the request, retrieve official evidence, and produce an answer, checklist, or informational form/dossier assessment. Separate branches handle multilingual conversation and controlled refusals. The repository also includes official-source ingestion and document indexing. Several agent and ingestion implementations were not sampled, so those capabilities and links are included only where the README or source index supports them.
Main entry points: agents_api.py Agent endpoints · answer.py Grounded answer · retrieval.py Dense retrieval · llm.py Chat and translation client
Components 26
User interface
- Telegram bridge
telegram_bridge/bridge.py - Menus and uploads
telegram_bridge/ui.py - Optional web demo
demo_ui/app.py
API and agents
- FastAPI application
backend/main.py - Agent endpoints
backend/agents_api.py - Intent and language routing
agents/intent_router.py - Conversation context
agents/dialogue.py - Grounded answer
agents/answer.py - Procedure checklist
agents/checklist_builder.py - Form assistance
agents/form_helper.py - Dossier readiness
agents/dossier_validator.py - Evidence and verification
agents/legal_evidence.py
Knowledge pipeline
- Procedure corpus
agents/corpus.py - Official-source ingestion
ingestion/pipeline.py - Source manifest
ingestion/manifest.py - Document extraction and indexing
rag/indexing.py - Routed retrieval
agents/retriever.py - Dense retrieval
rag/retrieval.py - Hybrid search
rag/hybrid.py - Qdrant vector store
rag/vector_store.py
Model services
- BGE-M3 embeddings
rag/embeddings.py - Chat and translation client
agents/llm.py - Versioned prompts
agents/prompts.py
Other components
- Telegram user
- n8n workflows
- Ollama models
Connections 31
- Telegram user → Telegram bridge: asks or uploads
- Telegram bridge → n8n workflows: posts webhook
- Telegram bridge → Menus and uploads: renders menus
telegram_bridge/bridge.py - n8n workflows → FastAPI application: invokes services
- FastAPI application → Agent endpoints: mounts endpoints
backend/main.py - Agent endpoints → Intent and language routing: routes requests
backend/agents_api.py - Agent endpoints → Conversation context: uses conversation
- Agent endpoints → Grounded answer: requests answers
backend/agents_api.py - Agent endpoints → Procedure checklist: requests checklists
backend/agents_api.py - Agent endpoints → Form assistance: requests form help
backend/agents_api.py - Agent endpoints → Dossier readiness: requests dossier check
backend/agents_api.py - Grounded answer → Dense retrieval: retrieves evidence
agents/answer.py - Grounded answer → Evidence and verification: checks support
agents/answer.py - Grounded answer → Chat and translation client: generates response
agents/answer.py - Procedure checklist → Procedure corpus: reads procedure structure
agents/checklist_builder.py - Procedure checklist → Chat and translation client: translates items
agents/checklist_builder.py - Form assistance → Procedure corpus: uses form records
agents/form_helper.py - Routed retrieval → Dense retrieval: runs dense search
agents/retriever.py - Routed retrieval → Hybrid search: selects hybrid search
agents/retriever.py - Dense retrieval → BGE-M3 embeddings: embeds query
rag/retrieval.py - Dense retrieval → Qdrant vector store: searches vectors
rag/retrieval.py - Hybrid search → Qdrant vector store: searches store
rag/hybrid.py - Document extraction and indexing → BGE-M3 embeddings: embeds chunks
rag/indexing.py - Document extraction and indexing → Qdrant vector store: writes vectors
rag/indexing.py - Official-source ingestion → Source manifest: records provenance
ingestion/pipeline.py - Official-source ingestion → Document extraction and indexing: feeds documents
- Procedure corpus → Source manifest: loads source records
agents/corpus.py - BGE-M3 embeddings → Ollama models: requests embeddings
rag/embeddings.py - Chat and translation client → Ollama models: requests generation
agents/llm.py - Chat and translation client → Versioned prompts: renders prompt specs
agents/llm.py - Telegram user → Optional web demo: uses fallback demo