FastAPI + Uvicorn webserver with a three-agent system (BuilderAgent, SearchAgent, and TaskIdentifierAgent) backed by ChromaDB vector storage for RAG-based workflow retrieval.
- BuilderAgent: Creates and edits workflows using structured LLM output via
ToolStrategy(Workflow) - SearchAgent: Retrieves relevant workflows from vector store using semantic similarity
- TaskIdentifierAgent: Uses agent structured-output calls for intent classification, deadline extraction, context detection, and task construction
- AnalyzerAgent: Analyzes traces from Confident AI to extract patterns and update knowledge files (user preferences, task patterns, workflow trends)
- ChromaVectorStore: Manages two ChromaDB collections (manual_workflows, generated_workflows) with OpenAI embeddings
POST /create_workflowaccepts aCreateWorkflowRequest(task, optionalrejected_workflows, optionaluser_feedback, optionalthread_id) and returns a structuredWorkflowPOST /edit_workflowaccepts anEditWorkflowRequest(task,proposed_workflow,feedback, optionalthread_id) and returns an updatedWorkflowPOST /edit_taskaccepts anEditTaskRequest(task,user_feedback, optionalthread_id) and returns anEditTaskResponsewithstatus: "edited", the editedTask, and context itemsPOST /search_workflowsaccepts aSearchWorkflowsRequest(task, optionalthread_id) and returns relevant workflows from the vector database using RAGPOST /identify_taskaccepts anIdentifyTaskRequest(text, optionalsubject, optionalmetadata, optionalthread_id) and returns one of:identifiedwithtask: Task, andcontext_items: List[ContextItem]no_taskwithtask: null, and emptycontext_items
POST /enrich_task_with_workflowsaccepts anEnrichTaskRequest(task, optionalthread_id), attaches candidate workflows, and returns the enriched taskPOST /analyze_tracesaccepts anAnalyzeTracesRequest(thread_id) and analyzes all traces from the thread to extract patterns and update knowledge filesPOST /populate_workflowsaccepts{ workflows: List[Workflow] }and returns inserted IDs/count for the manual workflow collectionGET /healthfor health checks
Note: All endpoints that invoke LLM agents accept an optional thread_id parameter. When provided, it is used for DeepEval logging to enable request tracing and observability. If not provided, a new UUID is generated automatically.
Knowledge Files: The analyzer agent maintains three runtime-generated knowledge files in the knowledge/ directory: user_preferences.txt, task_patterns.txt, and workflow_trends.txt. These are populated by analyzing traces from Confident AI and should not be committed to version control.
Environment Variables:
OPENAI_API_KEY(required): For LLM calls and embeddingsCONFIDENT_API_KEY(required for trace analysis): For fetching traces from Confident AI APICHROMA_PERSIST_DIR(optional): Vector DB persistence directory (default:./chroma_db)
Conda environment for clean local dev environments.
conda create -n "agents_ucsd" python==3.11
conda activate agents_ucsd
pip install -r requirements.txt
uvicorn app:app --reload --port 8080
If you want to use docker:
Build locally:
docker build -t workflow-planner .
docker run --rm -p 8080:8080 -e OPENAI_API_KEY=your_key workflow-plannerThe container starts with:
uvicorn app:app --host 0.0.0.0 --port $PORTRun integration tests:
python tests/test_suite.pyRun unit tests:
python -m unittest tests.task_unit_test -vConfiguration:
- Set
WORKFLOW_API_URLenvironment variable to point at a running server (defaults tohttp://127.0.0.1:8080) - Mock tasks in
./prompts/*.txtcan includerejected_workflows,proposed_workflow, andfeedbackfields