How songhaiwen-creator/enterprise-ai-workbench works
Enterprise AI Workbench is a B2B application for managing knowledge bases and documents, configuring agents and tools, and answering enterprise questions. Users interact through the Next.js UI and FastAPI API. The sampled retrieval path covers document indexing and semantic search: the API delegates to retrieval services, which chunk documents, obtain embeddings, and persist or query chunks. The tree and README identify additional auth, workspace, answer, agent, and tool capabilities; their internal wiring is not fully shown in the sampled source, so those links are kept conservative.
Main entry points: router.py API router · retrieval.py Index and search · page.tsx Workbench UI · api.ts API client
Components 26
User interface
- Workbench UI
frontend/app/page.tsx - Assistant UI
frontend/app/components/assistant.tsx - Knowledge Q&A UI
frontend/app/components/knowledge-qa.tsx - API client
frontend/utils/api.ts
API and access
- FastAPI app
backend/app/main.py - API router
backend/app/api/router.py - Auth routes
backend/app/api/routes/auth.py - Workspace routes
backend/app/api/routes/workspaces.py - Knowledge-base routes
backend/app/api/routes/knowledge_bases.py - Document routes
backend/app/api/routes/documents.py - Retrieval routes
backend/app/api/routes/retrieval.py - Answer routes
backend/app/api/routes/answers.py - Agent routes
backend/app/api/routes/agents.py - Tool routes
backend/app/api/routes/tools.py
Knowledge pipeline
- Index and search
backend/app/services/retrieval.py - Text chunking
backend/app/services/chunking.py - Document handling
backend/app/services/documents.py - Document extraction
backend/app/services/document_extraction.py - Embedding provider
backend/app/services/embeddings.py - PostgreSQL + vectors
backend/app/db/session.py
Agents and tools
- Answer generation
backend/app/services/answers.py - Intent routing
backend/app/services/routing.py - Tool selection
backend/app/services/tool_selection.py - Tool execution
backend/app/services/tool_execution.py
Other components
- Workbench user
- OpenAI
Connections 23
- Workbench user → Workbench UI: uses
- Workbench UI → Assistant UI: renders
- Workbench UI → Knowledge Q&A UI: renders
- Assistant UI → API client: requests
- Knowledge Q&A UI → API client: requests
- API client → FastAPI app: calls API
- FastAPI app → API router: mounts
- API router → Auth routes: dispatches
- API router → Workspace routes: dispatches
- API router → Knowledge-base routes: dispatches
- API router → Document routes: dispatches
- API router → Retrieval routes: dispatches
- API router → Answer routes: dispatches
- API router → Agent routes: dispatches
- API router → Tool routes: dispatches
- Retrieval routes → Index and search: calls
- Index and search → Document handling: loads document
- Index and search → Text chunking: splits text
- Index and search → Embedding provider: embeds text
- Index and search → PostgreSQL + vectors: reads and writes
- Document handling → PostgreSQL + vectors: loads records
- Embedding provider → OpenAI: requests embeddings
- Intent routing → OpenAI: classifies request