docs: update documentation for v0.2.0 tools release

README.md:
- Add Tatlock agent capabilities and tool descriptions
- Add requirements section (Ollama, SearXNG setup)
- Add configuration examples for external services
- Add tool usage examples and philosophy
- Add troubleshooting for Ollama and SearXNG
- Update test statistics

AGENTS.md:
- Refactor for LLM development focus
- Add PydanticAI tool registration pattern
- Add tool implementation guidelines
- Remove project status, focus on development instructions

IMPLEMENTATION_ROADMAP.md:
- Mark Phase 1 as "MOSTLY COMPLETE"
- Update detailed completion status
- Update current state summary
This commit is contained in:
2025-12-07 00:13:41 +01:00
parent 958363d44e
commit fd459e9ffb
3 changed files with 272 additions and 145 deletions
+92 -11
View File
@@ -9,8 +9,9 @@ A privacy-first, offline-capable personal assistant system that coordinates spec
-**Production-ready testing API** with OpenAI Responses API format
-**Open WebUI integration** with reasoning bubbles (`<think>` tags)
-**Conversation history** with auto-generated IDs and context management
-**Comprehensive testing** - 95 tests, 78.95% coverage
- 🚧 **PydanticAI integration** prepared for future real LLM connection
-**Tatlock PydanticAI Agent** - Real LLM integration with Ollama + permanent tools
- **Permanent Tools** - Calculator, date/time toolkit, web search (SearXNG)
-**Comprehensive testing** - 131 tests, 81.78% coverage
## Features
@@ -36,20 +37,32 @@ A privacy-first, offline-capable personal assistant system that coordinates spec
- **Parameter Validation**: Temperature (0.0-2.0), reasoning effort levels, max tokens, stop sequences
- **Real-time Enforcement**: Stop sequence detection and max token limits during streaming
### Testing Models
### Available Models
- **lorem-tester**: Full-featured mock agent with realistic behavior
- Configurable reasoning effort levels
- Random tool/function calls
- Error triggers for testing (rate_limit, context_overflow)
- **tatlock**: Placeholder for future PydanticAI agent
- **Tatlock**: Real PydanticAI agent with butler personality
- **LLM Backend**: Ollama (mistral-nemo:latest)
- **Personality**: Witty British butler, research-oriented
- **Permanent Tools**:
- **Calculator**: Safe mathematical expression evaluation (arithmetic, algebra, trigonometry, logarithms)
- **Date/Time Toolkit**: Current time, relative dates ("1 week ago"), time differences
- **Web Search**: Privacy-preserving search via SearXNG
- **Capabilities**: Streaming, reasoning, tool calling
- **Phase**: Phase 1 - Basic Integration (full household coordination coming in future phases)
## Requirements
- Python 3.12+ (Python 3.12.11 recommended)
- No external dependencies for mock API
- (Future: Network access for PydanticAI integration)
- **Ollama** (for Tatlock agent): Running locally or network-accessible
- Download: https://ollama.ai/
- Model: `ollama pull mistral-nemo:latest`
- **SearXNG** (for web search tool): Optional but recommended
- Docker: `docker run -d -p 8087:8080 searxng/searxng`
- Or use public instance (less private)
## Quick Start
@@ -164,6 +177,42 @@ curl http://localhost:8000/v1/responses \
**Note**: Client must send full conversation history in `input` array (OpenAI compatible). Server optionally tracks via `metadata.conversation_id` for future features.
### Using Tatlock with Tools
Tatlock automatically uses his permanent tools when appropriate:
```bash
# Mathematical calculation
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "Tatlock",
"messages": [{"role": "user", "content": "What is sqrt(144) + 25?"}]
}'
# Date/time queries
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "Tatlock",
"messages": [{"role": "user", "content": "What was the date 2 weeks ago?"}]
}'
# Web search for current information
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "Tatlock",
"messages": [{"role": "user", "content": "Search for recent Python 3.12 features"}]
}'
```
**Tatlock's Tool Usage Philosophy:**
- Uses calculator for ALL mathematics (even simple arithmetic)
- Uses date/time tools instead of guessing dates
- Searches for current/volatile information to verify facts
- Maintains a researcher's mindset with tool-assisted verification
## Open WebUI Integration
### Connection
@@ -205,9 +254,14 @@ pytest
# Run with coverage
pytest --cov=src --cov-report=term-missing
# Current: 95 tests, 78.95% coverage
# Current: 131 tests, 81.78% coverage
```
**Test Categories:**
- Unit tests: Agent tools, streaming, schemas
- Integration tests: Full API stack with real Ollama calls
- End-to-end tests: Chat completions, responses API
## Deployment
### Production Server
@@ -234,15 +288,24 @@ Create a `.env` file for custom configuration:
API_HOST=0.0.0.0
API_PORT=8000
# Ollama Configuration
OLLAMA_HOST=http://localhost:11434
OLLAMA_DEFAULT_MODEL=mistral-nemo:latest
OLLAMA_TIMEOUT=120
# SearXNG Configuration (for web search tool)
SEARXNG_HOST=http://localhost:8087
SEARXNG_TIMEOUT=30
# Logging
LOG_LEVEL=INFO
# CORS (default: allow all)
CORS_ORIGINS=["*"]
# Future: LLM configuration
```
See `.env.example` for full configuration options.
## Troubleshooting
### Streaming not working
@@ -260,19 +323,37 @@ CORS_ORIGINS=["*"]
- Or manually enable in Responses API: `"reasoning": {"effort": "medium", "summary": "auto"}`
- Check Open WebUI version supports `<think>` tags
### Tatlock agent errors
- Verify Ollama is running: `curl http://localhost:11434/api/tags`
- Check model is downloaded: `ollama list`
- Review environment variables: `OLLAMA_HOST`, `OLLAMA_DEFAULT_MODEL`
- Check logs: `tail -f logs/server.log`
### Web search not working
- Verify SearXNG is running: `curl http://localhost:8087/`
- Check `SEARXNG_HOST` environment variable
- SearXNG is optional - Tatlock will note if search is unavailable
## Project Structure
```
tatlock/
├── src/
│ ├── agents/ # Agent interface and implementations
│ │ ├── base.py # AgentInterface abstract class
│ │ ├── lorem_tester.py # Mock agent for testing
│ │ ├── tatlock.py # Real PydanticAI butler agent
│ │ ├── tools.py # Permanent tools (calculator, date/time, search)
│ │ └── registry.py # Model registry
│ ├── responses/ # Responses API (primary endpoint)
│ ├── chat/ # Chat Completions wrapper
│ ├── models/ # Models listing
│ ├── core/ # Shared utilities and config
│ └── main.py # Application entry point
├── tests/ # Comprehensive test suite
├── tests/ # Comprehensive test suite (131 tests)
├── AGENTS.md # LLM agent development guidelines
├── PHILOSOPHY.md # System vision and architecture
├── IMPLEMENTATION_ROADMAP.md # Development phases
├── CHANGELOG.md # Version history
└── README.md # This file
```
@@ -307,7 +388,7 @@ For LLM agent development guidelines and architectural decisions, see [AGENTS.md
## Version
Current version: **0.1.1** - Basic setup complete
Current version: **0.2.0** - PydanticAI Integration with Permanent Tools
---