Your open-source alternative to Agnost AI. Logs every conversation, analyzes intent + sentiment, detects failures, and suggests prompt improvements.
- Backend: FastAPI + SQLite + Anthropic API
- Frontend: React + Recharts + React Query
- SDK: Python (sync + async + decorator)
- Infra: Docker Compose
git clone <your-repo>
cd agnost-clone
cp .env.example .env
# Edit .env and add your ANTHROPIC_API_KEYdocker-compose up --buildOr run manually:
Backend:
cd backend
pip install -r requirements.txt
ANTHROPIC_API_KEY=sk-ant-... uvicorn main:app --reload --port 8000Frontend:
cd frontend
npm install
REACT_APP_API_URL=http://localhost:8000 npm startfrom agentlens import AgentLens
lens = AgentLens(api_key="ak_demo_123456789", base_url="http://localhost:8000")
# Log manually
lens.log(
user_message="How do I reset my password?",
agent_response="Click Forgot Password on the login page.",
session_id="user-123"
)
# Or use the decorator — auto-logs everything
@lens.watch
def my_agent(user_message: str) -> str:
return call_your_llm(user_message)
my_agent("What's the pricing?")@lens.watch_async
async def my_agent(user_message: str) -> str:
return await call_your_llm(user_message)curl -X POST http://localhost:8000/log \
-H "x-api-key: ak_demo_123456789" \
-H "Content-Type: application/json" \
-d '{"user_message": "Hello", "agent_response": "Hi there!"}'Triggers AI analysis of all unanalyzed conversations:
curl -X POST http://localhost:8000/analyze \
-H "x-api-key: ak_demo_123456789" \
-H "Content-Type: application/json" \
-d '{"limit": 100}'Or click "Run Analysis" in the dashboard.
cd backend
pip install httpx
python seed.py
# Then run analysis from dashboard| Method | Endpoint | Description |
|---|---|---|
| POST | /log |
Log a conversation |
| POST | /analyze |
Analyze unanalyzed conversations |
| GET | /dashboard |
Get all dashboard stats |
| GET | /conversations |
List conversations (paginated, filterable) |
| POST | /suggest-prompt |
Get AI prompt improvement suggestion |
| POST | /projects |
Create a new project |
All endpoints require x-api-key header.
curl -X POST http://localhost:8000/projects \
-H "Content-Type: application/json" \
-d '{"name": "My Second Agent"}'
# Returns: {"id": "...", "api_key": "ak_...", ...}Backend → Railway:
# Connect GitHub repo to Railway
# Set env var: ANTHROPIC_API_KEY=sk-ant-...
# Railway auto-detects DockerfileFrontend → Vercel:
cd frontend
npx vercel
# Set env: REACT_APP_API_URL=https://your-backend.railway.app- Auto-run analysis on a schedule (APScheduler)
- Email/Slack alerts when failure rate spikes
- Multi-tenant auth (JWT)
- OpenTelemetry ingestion endpoint
- Prompt version history
- A/B testing for prompts
- Webhook notifications
| Usage | Monthly Cost |
|---|---|
| 1,000 conversations analyzed | ~$0.05 |
| 10,000 conversations analyzed | ~$0.50 |
| 100,000 conversations analyzed | ~$5.00 |
Analysis uses Claude Sonnet in batch mode — extremely cheap.