* feat: add better params to working representation fetch in SDKs, return messages when added * fix: working representation routes now accepting all parameters properly, with tests * feat: add metadata/config fields to SDK objects where viable * fix: tests * feat: refactor SDKs to use representation config; [TEMP STAINLESS BUILD] update API * feat: add representation object to sdks * fix: use stainless sdk on branch * fix: update TypeScript SDK tsconfig to use node16 module resolution * fix: add isolatedModules = true to tsconfig * fix: lol * chore: coderabbit review * feat: make delete session real * feat: add observations routes with delete endpoints for documents. make session deletion real. * chore: type cleanup * fix: tests * chore: coderabbit review * fix: namespace by workspace * feat: add ability to customize messages_per_summary at both workspace and session level * chore: tests for summary config * chore: coderabbit cleanup * feat: make session and workspace config totally customizeable * feat: add search by peer knowledge (#250) * feat: search by peer perspective * fix: enforce workspace in filters, make messages distinct in join * fix: batch and merge migration steps * fix: add refresh, add config to workspace, add refresh function, make fields readonly * fix: search distinct * fix: merge migrations * fix: merge migrations * fix: batch deletions, improve comments, limit consolidate dream to 100 docs at a time, auth on observations routes * chore: review * chore: coderabbit * chore: review * chore: broken comment * feat: add set peer card route to API * feat: create advanced configuration parameters with message>session>workspace hierarchy * [wip] build unified testing harness * chore: lint * fix: cache invalidation, naming things, etc * feat: longmem tests * chore: peer config refactor * feat: consolidate dream working, refactor representation * fix: Various CR Comment Fixes * feat: Allow configurable Redis port for harness instances and update cleanup methods to be asynchronous. * fix: version bump, api/sdk updates * fix: observation endpoints, deletion queue, sdk observation implementation * chore: Fix migration order * fix: Use published stainless sdks * chore: (docs) update api-reference * fix: (docs) update based on api and sdk changes * fix: Code Rabbit Comments * fix: Code Rabbit Final Nits * fix: dream scheduler * fix: SDK model type consistency --------- Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| peer_card_tests | ||
| tests | ||
| .gitignore | ||
| README.md | ||
| beam.py | ||
| harness.py | ||
| longmem.py | ||
| peer_card_bench.py | ||
| run_tests.py | ||
README.md
Honcho Benchmark Suite
This directory contains benchmarking tools for evaluating Honcho's long-term memory capabilities.
Available Benchmarks
- LongMemEval: Tests memory retention across multi-session conversations
- BEAM: Beyond a Million Tokens - comprehensive long-term memory evaluation across 10 memory abilities
Development Harness
The development harness script makes it easy to run Honcho locally with a Docker database.
Overview
The harness.py script orchestrates the complete Honcho development environment:
- Database Setup: Starts a PostgreSQL database in Docker with a configurable port
- Database Provisioning: Runs Alembic migrations to set up the database schema
- Configuration: Uses environment variables to configure Honcho's database connection
- Service Startup: Starts both the FastAPI server and deriver process
- Configuration Verification: Prints the actual configuration that Honcho is using
- Monitoring: Provides real-time logs from all services
- Cleanup: Gracefully shuts down all services when stopped
Prerequisites
- Python 3.11+
- Docker and Docker Compose
- Honcho project dependencies installed (
uv sync)
Usage
Basic Usage
Run the harness with default settings (database on port 5433):
python tests/bench/harness.py
Custom Database Port
Run with a custom database port:
python tests/bench/harness.py --port 5434
Custom Project Root
If running from a different directory:
python tests/bench/harness.py --project-root /path/to/honcho
Command Line Options
--port: Port for the PostgreSQL database (default: 5433)--project-root: Path to the Honcho project root (default: current directory)
What Gets Started
When you run the harness, it will start:
- PostgreSQL Database: Running in Docker on the specified port
- FastAPI Server: Available at http://localhost:8000
- API Documentation: Available at http://localhost:8000/docs
- Deriver Process: Background worker for processing messages
Configuration
The harness uses environment variables to configure Honcho's database connection:
DB_CONNECTION_URI: Set topostgresql+psycopg://testuser:testpwd@localhost:{port}/honcho
The script will print the actual configuration that Honcho is using after the FastAPI server starts. This gives you complete visibility into how Honcho's configuration system resolved the settings from environment variables, config files, and defaults.
Stopping the Services
Press Ctrl+C to gracefully stop all services. The harness will:
- Stop the FastAPI server and deriver processes
- Stop the Docker database container
- Clean up temporary files (Docker Compose configuration)
Troubleshooting
Database Connection Issues
If the database fails to start or connect:
- Check if port 5433 (or your custom port) is already in use
- Ensure Docker is running
- Try a different port:
--port 5434
Configuration Issues
The script will print the actual configuration being used. If you see unexpected values:
- Check if you have a
config.tomlfile that might be overriding environment variables - Verify that the environment variables are being set correctly
- Check the Honcho configuration documentation for precedence rules
Integration with CI/CD
This harness can be used in CI/CD pipelines for integration testing. The script will:
- Use temporary directories for isolation
- Clean up all resources on exit
- Provide clear error messages for debugging
- Exit with appropriate status codes
- Use environment variables for configuration (no file conflicts)
Test Runner
The run_tests.py script executes JSON-formatted tests against a running Honcho instance. The harness must be running.
Running Tests
-
Start Honcho using the harness:
python tests/bench/harness.py -
In another terminal, run the tests:
# Run all tests python tests/bench/run_tests.py # Run a specific test # Test judge uses claude 3.5 sonnet python tests/bench/run_tests.py --test 1.json
Test Workflow
For each test, the runner:
- Creates a workspace for the test
- Adds all messages from the JSON to sessions
- Waits for deriver queue to be empty
- Executes queries as
.chat()calls - Judges responses using expected_response field
Test JSON Format
Tests are defined in JSON files with this structure:
{
"sessions": {
"session1": {
"messages": [
{
"peer": "alice",
"content": "Hello, how are you?"
},
{
"peer": "bob",
"content": "I'm good, thank you!"
}
]
}
},
"queries": [
{
"query": "How is Bob doing?",
"expected_response": "Good",
"session": "session1", // optional
"peer": "alice" // optional
}
]
}
Command Line Options
--tests-dir: Directory containing JSON test files (default: tests/bench/tests)--test: Run a specific test file--honcho-url: URL of running Honcho instance (default: http://localhost:8000)--anthropic-api-key: Anthropic API key for response judging, uses LLM_ANTHROPIC_API_KEY if not given--timeout: Timeout for deriver queue to empty (default: 60 seconds)