How sungminna/mcp_poc works
Project Type & Purpose
• Full-stack, retrieval-augmented chatbot platform.
• Three main deliverables:
• Core AI library (“lucia”) for extraction, embedding, storage, pipelines.
• FastAPI backend service (“react_mcp”) exposing REST API, orchestrating chat, RAG, tool servers.
• SvelteKit frontend (“velt”) for chat UI.
• Ancillary Django-style app (“lucia_backend”) for admin/user management (legacy or separate deployment).
File-Structure Analysis
• Top-level:
• docker-compose.yml, nginx.conf → deployment config
• lucia/ → Python core library (LLM clients, extractors, stores, vectorstores, pipelines)
• react_mcp/ → FastAPI app (main.py, routers/, services/, crud/, models/)
• lucia_backend/ → Django-style project (manage.py, chat_manager/, user_manager/)
• velt/ → SvelteKit frontend (src/, build/, .svelte-kit/)
• Key patterns:
• “lucia” core is a plugin-style package used by backend.
• “react_mcp” uses layered structure: routers → services → persistence.
• External tool servers (weather_server.py, math_server.py) co-hosted.
• Datastores & config:
• PostgreSQL (asyncpg + SQLAlchemy)
• Neo4j graph (neo4j-driver)
• Milvus vector store (pymilvus)
• Redis cache (aioredis)
• JWT, rate limiting, logging, Langfuse tracing
README Insights
• Startup sequence: migrations + DB/graph/vectorstore initialization.
• User flow: signup/login → PostgreSQL + Neo4j.
• Chat flow: extract → Neo4j persist → embed (Redis cache → Milvus) → graph & vector search → REACT agent → return & save to PostgreSQL.
• Asynchronous, scalable, modular.
• Frontend (velt SvelteKit)
• API Gateway / Nginx
• Backend microservices:
– FastAPI “react_mcp”
– Django “lucia_backend” (admin/user)
• Core library “lucia” (depicted as a shared module)
• External tool servers (Weather, Math)
• External APIs (OpenAI, LangGraph/LangChain)
• Datastores: PostgreSQL, Neo4j, Milvus, Redis
• Message broker / optional queue (if used)
• User ↔ Frontend
• Frontend → API (JWT, CORS) via Nginx
• API → Authentication & Rate-Limit
• FastAPI:
– CRUD → PostgreSQL
– Graph operations → Neo4j
– Embeddings → OpenAI → Redis cache → Milvus
– Vector search → Milvus
– Prompt orchestration → LangChain/REACT → returns content
– Tool calls → Weather/math servers
• Django backend → PostgreSQL + Neo4j for admin
c. Architectural Patterns:
• Layered (routers → services → persistence)
• Plugin/Factory (lucia’s pluggable extractors, clients, stores)
• RAG pipeline (LLM + vector + graph)
• Microservices (distinct FastAPI & Django roles)
d. Key Technologies:
• FastAPI, Uvicorn, async SQLAlchemy, aioredis
• Neo4j-driver, pymilvus, OpenAI SDK
• SvelteKit, Vite
• JWT (python-jose), bcrypt, slowapi
• Docker, Docker-Compose, Nginx