Spaces:
Sleeping
Sleeping
IntegraChat - Current File Structure
IntegraChat/
βββ backend/
β βββ api/
β β βββ main.py # FastAPI main application
β β βββ mcp_clients/
β β β βββ admin_client.py # Admin MCP client
β β β βββ mcp_client.py # Main MCP client wrapper
β β β βββ rag_client.py # RAG MCP client
β β β βββ web_client.py # Web search MCP client
β β βββ models/
β β β βββ __init__.py
β β β βββ agent.py # Agent request/response models
β β β βββ redflag.py # Red flag rule models
β β βββ routes/
β β β βββ admin.py # Admin routes
β β β βββ agent.py # Agent chat routes
β β β βββ analytics.py # Analytics routes
β β β βββ rag.py # RAG routes
β β β βββ web.py # Web search routes
β β βββ services/
β β β βββ agent_orchestrator.py # Main orchestrator (multi-tool execution)
β β β βββ intent_classifier.py # Intent classification service
β β β βββ llm_client.py # LLM client (Ollama/Groq)
β β β βββ prompt_builder.py # Prompt building utilities
β β β βββ redflag_detector.py # Red flag detection service
β β β βββ tool_selector.py # Multi-tool selection logic
β β βββ utils/
β β βββ text_extractor.py # Text extraction utilities
β βββ mcp_servers/
β β βββ admin_server.py # Admin MCP server
β β βββ database.py # Database connection utilities
β β βββ embeddings.py # Embedding generation
β β βββ main.py # RAG MCP server main
β β βββ rag_server.py # RAG MCP server
β β βββ web_server.py # Web search MCP server (English results)
β β βββ models/
β β βββ __init__.py
β β βββ admin.py # Admin request models
β β βββ rag.py # RAG request models
β β βββ web.py # Web search request models
β βββ tests/
β β βββ conftest.py # Pytest configuration
β β βββ test_agent_orchestrator.py # Orchestrator tests
β β βββ test_intent.py # Intent classification tests
β βββ workers/ # Background workers (empty)
β
βββ venv/ # Python virtual environment
βββ env.example # Environment variables template
βββ pytest.ini # Pytest configuration
βββ README.md # Project documentation
βββ requirements.txt # Python dependencies
βββ start.bat # Windows startup script
Key Files Overview
Core Services
agent_orchestrator.py- Main orchestrator handling multi-tool executiontool_selector.py- Intelligent multi-tool selection (RAG + Web + LLM)intent_classifier.py- Classifies user intentredflag_detector.py- Detects policy violations
MCP Servers
rag_server.py- RAG/knowledge retrieval serverweb_server.py- Web search server (forces English results)admin_server.py- Admin/governance server
API Routes
agent.py- Main chat/agent endpointrag.py- RAG operationsweb.py- Web search operationsadmin.py- Admin operationsanalytics.py- Analytics endpoints
Models
agent.py- AgentRequest, AgentDecision, AgentResponseredflag.py- RedFlagRule, RedFlagMatch
MCP Clients
mcp_client.py- Unified MCP client wrapperrag_client.py- RAG clientweb_client.py- Web search clientadmin_client.py- Admin client