-
Notifications
You must be signed in to change notification settings - Fork 2
docs: Comprehensive documentation with Mermaid diagrams and Chutes API integration #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| # BaseAgent Documentation | ||
|
|
||
| > **Professional documentation for the BaseAgent autonomous coding assistant** | ||
|
|
||
| BaseAgent is a high-performance autonomous agent designed for the [Term Challenge](https://term.challenge). It leverages LLM-driven decision making with advanced context management and cost optimization techniques. | ||
|
|
||
| --- | ||
|
|
||
| ## Table of Contents | ||
|
|
||
| ### Getting Started | ||
| - [Overview](./overview.md) - What is BaseAgent and core design principles | ||
| - [Installation](./installation.md) - Prerequisites and setup instructions | ||
| - [Quick Start](./quickstart.md) - Your first task in 5 minutes | ||
|
|
||
| ### Core Concepts | ||
| - [Architecture](./architecture.md) - Technical architecture and system design | ||
| - [Configuration](./configuration.md) - All configuration options explained | ||
| - [Usage Guide](./usage.md) - Command-line interface and options | ||
|
|
||
| ### Reference | ||
| - [Tools Reference](./tools.md) - Available tools and their parameters | ||
| - [Context Management](./context-management.md) - Token management and compaction | ||
| - [Best Practices](./best-practices.md) - Optimal usage patterns | ||
|
|
||
| ### LLM Providers | ||
| - [Chutes API Integration](./chutes-integration.md) - Using Chutes as your LLM provider | ||
|
|
||
| --- | ||
|
|
||
| ## Quick Navigation | ||
|
|
||
| | Document | Description | | ||
| |----------|-------------| | ||
| | [Overview](./overview.md) | High-level introduction and design principles | | ||
| | [Installation](./installation.md) | Step-by-step setup guide | | ||
| | [Quick Start](./quickstart.md) | Get running in minutes | | ||
| | [Architecture](./architecture.md) | Technical deep-dive with diagrams | | ||
| | [Configuration](./configuration.md) | Environment variables and settings | | ||
| | [Usage](./usage.md) | CLI commands and examples | | ||
| | [Tools](./tools.md) | Complete tools reference | | ||
| | [Context Management](./context-management.md) | Memory and token optimization | | ||
| | [Best Practices](./best-practices.md) | Tips for optimal performance | | ||
| | [Chutes Integration](./chutes-integration.md) | Chutes API setup and usage | | ||
|
|
||
| --- | ||
|
|
||
| ## Architecture at a Glance | ||
|
|
||
| ```mermaid | ||
| graph TB | ||
| subgraph User["User Interface"] | ||
| CLI["CLI (agent.py)"] | ||
| end | ||
|
|
||
| subgraph Core["Core Engine"] | ||
| Loop["Agent Loop"] | ||
| Context["Context Manager"] | ||
| Cache["Prompt Cache"] | ||
| end | ||
|
|
||
| subgraph LLM["LLM Layer"] | ||
| Client["LiteLLM Client"] | ||
| Provider["Provider (Chutes/OpenRouter)"] | ||
| end | ||
|
|
||
| subgraph Tools["Tool System"] | ||
| Registry["Tool Registry"] | ||
| Shell["shell_command"] | ||
| Files["read_file / write_file"] | ||
| Search["grep_files / list_dir"] | ||
| end | ||
|
|
||
| CLI --> Loop | ||
| Loop --> Context | ||
| Loop --> Cache | ||
| Loop --> Client | ||
| Client --> Provider | ||
| Loop --> Registry | ||
| Registry --> Shell | ||
| Registry --> Files | ||
| Registry --> Search | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Key Features | ||
|
|
||
| - **Fully Autonomous** - No user confirmation required; makes decisions independently | ||
| - **LLM-Driven** - All decisions made by the language model, not hardcoded logic | ||
| - **Prompt Caching** - 90%+ cache hit rate for significant cost reduction | ||
| - **Context Management** - Intelligent pruning and compaction for long tasks | ||
| - **Self-Verification** - Automatic validation before task completion | ||
| - **Multi-Provider** - Supports Chutes AI, OpenRouter, and litellm-compatible providers | ||
|
|
||
| --- | ||
|
|
||
| ## Project Structure | ||
|
|
||
| ``` | ||
| baseagent/ | ||
| ├── agent.py # Entry point | ||
| ├── src/ | ||
| │ ├── core/ | ||
| │ │ ├── loop.py # Main agent loop | ||
| │ │ └── compaction.py # Context management | ||
| │ ├── llm/ | ||
| │ │ └── client.py # LLM client (litellm) | ||
| │ ├── config/ | ||
| │ │ └── defaults.py # Configuration | ||
| │ ├── tools/ # Tool implementations | ||
| │ ├── prompts/ | ||
| │ │ └── system.py # System prompt | ||
| │ └── output/ | ||
| │ └── jsonl.py # JSONL event emission | ||
| ├── rules/ # Development guidelines | ||
| ├── astuces/ # Implementation techniques | ||
| └── docs/ # This documentation | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## License | ||
|
|
||
| MIT License - See [LICENSE](../LICENSE) for details. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix hyphenation for compound adjective.
The phrase "LLM-driven decision making" should use a hyphen: "LLM-driven decision-making". As per coding guidelines, use a hyphen to join words in compound adjectives.
✏️ Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 LanguageTool
[grammar] ~5-~5: Use a hyphen to join words.
Context: ...lenge). It leverages LLM-driven decision making with advanced context management ...
(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents