Backend-specific technical documentation for ComponentForge.
- Backend Architecture - Complete backend system architecture, module organization, and patterns
- AI Pipeline - LangChain/LangGraph workflows, multi-agent orchestration, and LLM integration
- Database Schema - PostgreSQL schema, models, queries, and migration strategies
- Generation Service - Code generation system architecture
- Prompting Guide - Prompt engineering best practices
- Monitoring - Observability and LangSmith setup
- Troubleshooting - Common issues and solutions
- Caching Analysis - Comprehensive analysis of caching strategies (prompt, embedding, result caching)
- Guardrails Analysis - Security guardrails assessment and implementation review
# Start Docker services
docker-compose up -d
# Activate virtual environment
cd backend && source venv/bin/activate
# Run development server
uvicorn src.main:app --reload
# Run tests
pytest tests/ -v
# Run migrations
alembic upgrade head- Framework: FastAPI with async/await
- AI: LangChain, LangGraph, LangSmith
- Database: PostgreSQL with SQLAlchemy (async)
- Vector DB: Qdrant for semantic search
- Cache: Redis for sessions and rate limiting
- Models: OpenAI GPT-4, GPT-4V, text-embedding-3-small
The backend follows a layered architecture:
- API Layer (
src/api/v1/) - REST endpoints - Service Layer (
src/services/) - Business logic - Agent Layer (
src/agents/) - LangGraph AI agents - Data Layer (
src/models/) - Database models - RAG Layer (
src/rag/) - Vector operations