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_server/
β β βββ server.py # Unified MCP entrypoint (rag/web/admin)
β β βββ rag/ # RAG tool handlers (search/ingest/delete)
β β βββ web/ # Web search tool handler
β β βββ admin/ # Admin rules + violations tools
β β βββ common/ # Shared tenant/logging/utils helpers
β βββ 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
backend/mcp_server/server.py- Unified MCP entrypoint (rag/web/admin tools)backend/mcp_server/rag/*.py- RAG tool handlers (search/ingest/delete)backend/mcp_server/web/search.py- DuckDuckGo handlerbackend/mcp_server/admin/*.py- Admin rules & violations tools
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