WriteSense Agent is an intelligent assistant designed to help people with disabilities create and work with documents. The agent coordinates multiple specialized sub-agents using a hierarchical architecture and responds in Vietnamese to provide accessible document creation support.
- Document Creation Support: Help users write reports, diaries, and various documents
- Vietnamese Language: Always responds in Vietnamese for accessibility
- Multi-Agent System: Orchestrator coordinates specialized agents for different tasks
- Disability-Friendly: Simple, clear interactions with step-by-step guidance
git clone https://github.com/AI4LI-Language/write-sense-agent.git
cd write-sense-agent# Create virtual environment
python3 -m venv venv
# Activate it
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Install project in development mode
pip install -e .Copy the environment template and add your API keys:
cp env.template .envEdit .env file and add your API keys:
# At minimum, you need one of these:
OPENAI_API_KEY=your_openai_api_key_here
# OR
ANTHROPIC_API_KEY=your_anthropic_api_key_herepython examples/basic_usage.pyYou should see the agent respond in Vietnamese! π
docker-compose up --build -dor
docker-compose up --buildThis starts:
- WriteSense Agent on
http://localhost:8123 - PostgreSQL database on port
5433 - Redis cache on port
6379
# Check if service is running
curl http://localhost:8123/ok
# Chat with the agent
python chat_with_agent.py# Create a thread
curl -X POST http://localhost:8123/threads -H "Content-Type: application/json" -d '{}'
# Send a message (replace THREAD_ID with actual ID)
curl -X POST http://localhost:8123/threads/THREAD_ID/runs \
-H "Content-Type: application/json" \
-d '{
"assistant_id": "agent",
"input": {"messages": [{"role": "user", "content": "Bẑn có thỠgiúp gì cho tôi?"}]}
}'http://localhost:8123/docsβββββββββββββββββββββββββββββββββββββββ
β Orchestrator Agent β β GPT-4.1 (Powerful model)
β (Coordination & Vietnamese) β
βββββββββββββββ¬ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β Document Retriever Agent β β GPT-4o-mini (Fast model)
β (Document Operations) β
βββββββββββββββ¬ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β MCP Server β
β (Document Retrieval Tools) β
βββββββββββββββββββββββββββββββββββββββ
Key Features:
- Separate Models: Orchestrator uses powerful model, sub-agents use fast models
- Dynamic Delegation: Automatically chooses right agent for each task
- Vietnamese Output: All responses in Vietnamese for accessibility
- Disability Support: Simple, clear, step-by-step guidance
# Orchestrator Model (Primary coordination)
ORCHESTRATOR_LLM_PROVIDER=openai
ORCHESTRATOR_LLM_MODEL=gpt-4o
# MCP Agents Model (Task execution)
MCP_AGENTS_LLM_PROVIDER=openai
MCP_AGENTS_LLM_MODEL=gpt-4o-mini
# API Keys
OPENAI_API_KEY=your_key_here
ANTHROPIC_API_KEY=your_key_here- Create MCP Server (in
mcp_servers/directory) - Add to Configuration (automatically discovered)
- Restart System (agents are created automatically)
The system automatically:
- Creates one agent per MCP server
- Generates dynamic delegation guidelines
- Updates orchestrator prompt with new capabilities
python chat_with_agent.py
# Ask: "Xin chΓ o"
# Expect: Vietnamese greeting response# Ask: "Bẑn có thỠlà m gì?"
# Expect: Vietnamese description + delegation to document agent# Ask: "GiΓΊp tΓ΄i viαΊΏt mα»t bΓ‘o cΓ‘o"
# Expect: Step-by-step guidance in Vietnamese1. API Key Errors
# Check your .env file has the right keys
cat .env | grep API_KEY2. Docker Not Starting
# Check Docker status
docker-compose ps
# View logs
docker logs write-sense-agent3. Agent Not Responding in Vietnamese
# Check system prompt in logs
docker logs write-sense-agent | grep "Vietnamese"4. No Tool Calls/Delegation
# Check MCP agent registration
docker logs write-sense-agent | grep "Registered agents"- Check the logs:
docker logs write-sense-agent - Verify environment:
docker-compose ps - Test basic endpoints:
curl http://localhost:8123/ok
write-sense-agent/
βββ src/write_sense_agent/
β βββ core/
β β βββ config.py # Configuration management
β β βββ orchestrator.py # Main orchestrator agent
β β βββ mcp_agent.py # MCP agent wrapper
β βββ graph.py # Agent graph creation
βββ mcp_servers/
β βββ document_retriever.py # Document MCP server
βββ examples/
β βββ basic_usage.py # Simple test script
βββ docker-compose.yml # Docker services
βββ chat_with_agent.py # Interactive chat client
βββ env.template # Environment template
βββ README.md # This file
- Customize for Your Needs: Modify system prompts in
config.py - Add More MCP Servers: Create new servers in
mcp_servers/ - Extend Capabilities: Add new tools to existing servers
- Deploy to Production: Use
langgraph deployfor cloud deployment
- Fork the repository
- Create feature branch:
git checkout -b feature/my-feature - Make changes and test:
python examples/basic_usage.py - Commit:
git commit -m "Add my feature" - Push:
git push origin feature/my-feature - Create Pull Request
Built with LangGraph + MCP for accessible document creation π
Designed specifically to help people with disabilities create and work with documents through simple, Vietnamese language interactions.