This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
PulseBot is a stream-native AI agent framework powered by Timeplus (streaming SQL database). All communication, events, and state changes flow through Timeplus streams rather than traditional file systems or databases.
# CLI commands (after installation)
pulsebot run # Start agent main loop (listens to message streams)
pulsebot serve # Start FastAPI server on port 8000
pulsebot chat # Interactive CLI chat
pulsebot init # Generate default config.yaml
pulsebot task list # List scheduled tasks
# Development
pytest # Run all tests
pytest -v # Verbose test output
pytest --cov # Run tests with coverage
ruff check . # Lint code
mypy pulsebot/ # Type checking
# Docker deployment
docker-compose up -d # Start all services (proton, agent, api)All components communicate via Timeplus streams (unbounded append-only data):
- Input Channels (Telegram, Webchat) → Write to
messagesstream - Agent Core → Reads from
messages, processes via LLM, writes responses back - Skills/Tools → Execute when called, results flow back through messages
- Observability → All LLM calls logged to
llm_logsstream, memories tomemorystream
1. Listen for messages targeting 'agent' on messages stream
2. For each message:
a. Build context (conversation history + relevant memories via vector search)
b. Get available tools from loaded skills
c. Loop (max 10 iterations):
- Call LLM with context + tools
- Log call to llm_logs stream
- If tool calls: execute tools, add results to context
- Else: send response, extract/store memories, break
pulsebot/core/- Agent loop, context building, tool execution, routingpulsebot/providers/- LLM provider implementations (Anthropic, OpenAI, OpenRouter, Ollama, NVIDIA)pulsebot/skills/- Tool/skill system with builtin skills (file_ops, shell)pulsebot/channels/- Input channels (Telegram bot integration)pulsebot/timeplus/- Timeplus client, stream reader/writer, vector memory, scheduled taskspulsebot/api/- FastAPI server with REST and WebSocket endpointspulsebot/web/- Web chat UI (served at http://localhost:8000/)
| Stream | Purpose |
|---|---|
messages |
Central communication hub (source, target, session_id, content) |
llm_logs |
LLM call observability (model, tokens, latency, status) |
memory |
Vector-indexed knowledge base with embeddings |
events |
System events and alerts |
Provider Pattern: All LLM providers implement LLMProvider base class with async chat() returning LLMResponse
Skill Pattern: Skills inherit from BaseSkill with get_tools() → ToolDefinition and async execute() → ToolResult
Stream Operations: StreamReader for async iteration, StreamWriter for writes, TimeplusClient for low-level protocol
config.yaml uses Pydantic validation with environment variable substitution (${VAR_NAME} or ${VAR_NAME:-default}):
agent: name, model, provider, temperaturetimeplus: host, port, credentialsproviders: API keys for Anthropic, OpenAI, OpenRouter, Ollama, NVIDIAchannels: Telegram settingsskills: enabled builtin skills
- Python 3.11+
- Timeplus/Proton (streaming database, port 8463)