Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bojieli/ai-agent-book
/ types & classes
Types & classes
570 in github.com/bojieli/ai-agent-book
⨍
Functions
2,925
◇
Types & classes
570
↳
Endpoints
80
↓ 79 callers
Class
SVG
SVG diagram builder.
book/svg_lib.py:68
↓ 55 callers
Class
ActionResponse
Standard response format for all perception tool actions.
chapter4/perception-tools/src/base.py:16
↓ 24 callers
Class
ContextAwareAgent
AI Agent with configurable LLM providers and context modes for ablation studies
chapter1/context/agent.py:306
↓ 21 callers
Class
GrepTool
Pure Python grep implementation
chapter5/coding-agent/tools/grep_tool.py:14
↓ 17 callers
Class
BashTool
Executes bash commands in persistent shell sessions
chapter5/coding-agent/tools/bash_tool.py:12
↓ 16 callers
Class
EloRatingSystem
Implementation of Elo rating system for model comparison. The Elo system updates ratings based on pairwise comparison outcomes, wher
chapter6/elo-leaderboard/elo_rating.py:9
↓ 16 callers
Class
LLMHelper
Helper class for LLM-based operations.
chapter4/execution-tools/llm_helper.py:9
↓ 15 callers
Class
TreasureHuntGame
A text-based game with hidden mechanics that agents must discover: 1. Certain colored keys open corresponding colored doors 2. Guards blo
chapter1/learning-from-experience/game_environment.py:39
↓ 14 callers
Class
MultimodalAgent
Main agent class supporting multiple extraction modes
chapter3/multimodal-agent/agent.py:280
↓ 13 callers
Class
MultimodalContent
Container for multimodal content
chapter3/multimodal-agent/agent.py:50
↓ 12 callers
Class
Message
chapter2/prompt-engineering/tau_bench/model_utils/model/chat.py:40
↓ 12 callers
Class
ReadTool
Reads files from the local filesystem
chapter5/coding-agent/tools/read_tool.py:11
↓ 11 callers
Class
EditTool
Performs exact string replacements in files
chapter5/coding-agent/tools/edit_tool.py:11
↓ 11 callers
Class
LSTool
Lists files and directories
chapter5/coding-agent/tools/ls_tool.py:12
↓ 11 callers
Class
NotebookEditTool
Completely replaces the contents of a specific cell in a Jupyter notebook
chapter5/coding-agent/tools/notebook_edit_tool.py:11
↓ 11 callers
Class
SystemHintConfig
Configuration for system hints
chapter2/system-hint/agent.py:60
↓ 11 callers
Class
WriteTool
Writes files to the local filesystem
chapter5/coding-agent/tools/write_tool.py:11
↓ 10 callers
Class
ConversationChunk
A chunk of conversation with metadata
chapter3/contextual-retrieval-for-user-memory/chunker.py:33
↓ 9 callers
Class
ConversationMessage
Single message in a conversation
chapter3/contextual-retrieval-for-user-memory/chunker.py:22
↓ 9 callers
Class
GlobTool
Fast file pattern matching tool
chapter5/coding-agent/tools/glob_tool.py:11
↓ 9 callers
Class
KVCacheAgent
ReAct Agent with different KV cache optimization modes
chapter2/kv-cache/agent.py:318
↓ 9 callers
Class
MemoryIndexer
Indexes and searches conversation chunks using the retrieval pipeline service
chapter3/agentic-rag-for-user-memory/indexer.py:43
↓ 9 callers
Class
MemoryIndexer
Indexes and searches conversation chunks using the retrieval pipeline service
chapter3/contextual-retrieval-for-user-memory/indexer.py:43
↓ 9 callers
Class
MultiEditTool
Makes multiple edits to a single file in one operation
chapter5/coding-agent/tools/multi_edit_tool.py:11
↓ 9 callers
Class
SystemHintAgent
AI Agent with enhanced system hints for better trajectory management
chapter2/system-hint/agent.py:73
↓ 8 callers
Class
LearningAgent
An agent that learns from experience and can replay learned workflows. This agent: 1. Attempts to match tasks to learned workflows
chapter8/browser-use-rpa/learning_agent/agent.py:31
↓ 8 callers
Class
ModelError
chapter2/prompt-engineering/tau_bench/model_utils/model/exception.py:7
↓ 8 callers
Class
TodoWriteTool
Creates and manages structured task lists
chapter5/coding-agent/tools/todo_write_tool.py:9
↓ 8 callers
Class
ToolRegistry
Registry for managing available tools
chapter2/local_llm_serving/tools.py:16
↓ 7 callers
Class
Action
chapter2/prompt-engineering/tau_bench/types.py:10
↓ 7 callers
Class
AgenticRAG
Agentic RAG system with ReAct pattern and multiple LLM provider support
chapter3/agentic-rag/agent.py:28
↓ 7 callers
Class
ConversationChunk
A chunk of conversation with metadata
chapter3/agentic-rag-for-user-memory/chunker.py:33
↓ 7 callers
Class
ExecutionTools
Generic execution tools with safety and result analysis.
chapter4/execution-tools/execution_tools.py:14
↓ 7 callers
Class
MemoryProcessorConfig
Configuration for the background memory processor
chapter3/user-memory/background_memory_processor.py:35
↓ 7 callers
Class
Message
Unified message format
chapter3/multimodal-agent/agent.py:29
↓ 6 callers
Class
AdvancedMemoryCard
Represents an advanced memory card with complete metadata. Each card MUST include: - backstory: Context about when/why this informat
chapter3/contextual-retrieval-for-user-memory/advanced_memory_manager.py:20
↓ 6 callers
Class
BackgroundMemoryProcessor
Background processor that analyzes conversations and updates memory Runs separately from the main conversation flow
chapter3/user-memory/background_memory_processor.py:45
↓ 6 callers
Class
CompressedContent
Represents compressed content
chapter2/context-compression/compression_strategies.py:31
↓ 6 callers
Class
ConversationMessage
Single message in a conversation
chapter3/agentic-rag-for-user-memory/chunker.py:22
↓ 6 callers
Class
ConversationalAgent
Pure conversational agent that focuses on dialogue Reads memory for context but doesn't update it directly
chapter3/user-memory/conversational_agent.py:32
↓ 6 callers
Class
ExternalTools
External system integration tools.
chapter4/execution-tools/external_tools.py:30
↓ 6 callers
Class
FileTools
File system tools with verification and safety checks.
chapter4/execution-tools/file_tools.py:10
↓ 6 callers
Class
GPT5NativeAgent
GPT-5 Agent with Native Tool Support This agent uses GPT-5's native web_search and code_interpreter capabilities through the OpenRou
chapter1/search-codegen/agent.py:35
↓ 6 callers
Class
MemoryTools
Tools for searching and retrieving user memory information
chapter3/contextual-retrieval-for-user-memory/tools.py:33
↓ 6 callers
Class
Task
chapter2/prompt-engineering/tau_bench/types.py:15
↓ 5 callers
Class
AdvancedWebSearchAgent
高级 Web Search Agent - 扩展功能
chapter1/web-search-agent/examples.py:16
↓ 5 callers
Class
ClassifyDatapoint
chapter2/prompt-engineering/tau_bench/model_utils/api/datapoint.py:131
↓ 5 callers
Class
CodingAgent
Main coding agent with streaming support and modular tool system
chapter5/coding-agent/agent.py:18
↓ 5 callers
Class
Config
Main configuration class for multimodal agent
chapter3/multimodal-agent/config.py:34
↓ 5 callers
Class
ContextualMemoryEvaluator
Evaluates the dual memory system on test cases
chapter3/contextual-retrieval-for-user-memory/contextual_evaluator.py:123
↓ 5 callers
Class
ContextualMemoryIndexer
Dual-layer memory indexer combining: 1. Contextual RAG for conversation chunks 2. Advanced JSON cards for structured facts
chapter3/contextual-retrieval-for-user-memory/contextual_indexer.py:45
↓ 5 callers
Class
ContextualUserMemoryAgent
Agent with dual memory system: structured cards + contextual RAG
chapter3/contextual-retrieval-for-user-memory/contextual_agent.py:64
↓ 5 callers
Class
ConversationConfig
Configuration for the conversational agent
chapter3/user-memory/conversational_agent.py:23
↓ 5 callers
Class
KnowledgeBase
Manages storage and retrieval of learned workflows. The knowledge base provides: - Persistent storage of workflows - Intent matc
chapter8/browser-use-rpa/learning_agent/knowledge_base.py:31
↓ 5 callers
Class
LLMEvaluator
LLM-based evaluator for agent responses.
chapter3/user-memory-evaluation/evaluator.py:11
↓ 5 callers
Class
LocalFileTools
Local implementations of file system tools
chapter2/kv-cache/agent.py:61
↓ 5 callers
Class
MemoryTools
Tools for searching and retrieving user memory information
chapter3/agentic-rag-for-user-memory/tools.py:33
↓ 5 callers
Class
SparseSearchEngine
Main search engine combining all components
chapter3/sparse-embedding/bm25_engine.py:365
↓ 5 callers
Class
SystemHintConfig
Configuration for system hints
chapter4/agent-with-event-trigger/agent.py:66
↓ 5 callers
Class
SystemState
System state tracking for system hints
chapter5/coding-agent/system_state.py:13
↓ 5 callers
Class
ToolRegistry
Registry for available tools
chapter1/context/agent.py:53
↓ 5 callers
Class
UserMemoryEvaluator
Evaluates the RAG agent on user memory test cases
chapter3/agentic-rag-for-user-memory/evaluator.py:119
↓ 5 callers
Class
Workflow
Represents a complete workflow that can be learned and replayed
chapter8/browser-use-rpa/learning_agent/workflow.py:97
↓ 4 callers
Class
AgentConfig
Configuration for the System-Hint Agent
chapter2/system-hint/config.py:11
↓ 4 callers
Class
BashOutputTool
Retrieves output from running or completed background bash shells
chapter5/coding-agent/tools/bash_output_tool.py:11
↓ 4 callers
Class
ContextualChunk
Enhanced chunk with contextual information
chapter3/contextual-retrieval/contextual_chunking.py:26
↓ 4 callers
Class
ContextualChunker
Implements contextual chunking inspired by Anthropic's Contextual Retrieval. Key Educational Points: 1. Context Generation: Uses LLM
chapter3/contextual-retrieval/contextual_chunking.py:54
↓ 4 callers
Class
ConversationChunker
Chunks conversation histories into segments for RAG indexing
chapter3/contextual-retrieval-for-user-memory/chunker.py:90
↓ 4 callers
Class
ConversationHistory
A conversation history containing multiple messages.
chapter3/user-memory-evaluation/models.py:25
↓ 4 callers
Class
Document
Document data class.
chapter3/dense-embedding/document_store.py:11
↓ 4 callers
Class
EventTriggeredAgent
Event-Triggered AI Agent with System Hints Responds to events while maintaining all system hint capabilities
chapter4/agent-with-event-trigger/agent.py:207
↓ 4 callers
Class
GraphRAGIndexer
GraphRAG knowledge graph indexer with entity extraction and community detection.
chapter3/structured-index/graphrag_indexer.py:58
↓ 4 callers
Class
InvertedIndex
Inverted index data structure for efficient term lookup
chapter3/sparse-embedding/bm25_engine.py:116
↓ 4 callers
Class
KnowledgeBaseType
Knowledge base backend types
chapter3/contextual-retrieval/config.py:22
↓ 4 callers
Class
KnowledgeBaseType
Knowledge base backend types
chapter3/agentic-rag/config.py:22
↓ 4 callers
Class
LLMAgent
LLM-based agent that uses in-context learning to play the game. Stores experiences and uses them to reason about future actions.
chapter1/learning-from-experience/llm_agent.py:25
↓ 4 callers
Class
OllamaNativeAgent
Agent using Ollama's native tool calling support
chapter2/local_llm_serving/ollama_native.py:16
↓ 4 callers
Class
PubChemMetadata
Metadata for PubChem operation results.
chapter4/perception-tools/src/pubchem_tools.py:35
↓ 4 callers
Class
QLearningAgent
Q-learning agent for the treasure hunt game. Uses tabular Q-learning with state-action pairs.
chapter1/learning-from-experience/rl_agent.py:14
↓ 4 callers
Class
RaptorIndexer
RAPTOR tree-based document indexer with recursive summarization.
chapter3/structured-index/raptor_indexer.py:37
↓ 4 callers
Class
ResearchAgent
AI Agent for researching with context compression
chapter2/context-compression/agent.py:49
↓ 4 callers
Class
SearchResult
Search result from knowledge base
chapter3/contextual-retrieval/tools.py:15
↓ 4 callers
Class
SearchResult
Search result from knowledge base
chapter3/agentic-rag/tools.py:15
↓ 4 callers
Class
SolveResult
chapter2/prompt-engineering/tau_bench/types.py:38
↓ 4 callers
Class
ToolCallingAgent
Universal tool calling agent that works on all platforms Automatically selects vLLM (if GPU available) or Ollama
chapter2/local_llm_serving/main.py:23
↓ 4 callers
Class
UserMemoryRAGAgent
Agent that uses RAG to answer questions about user conversation history
chapter3/agentic-rag-for-user-memory/agent.py:58
↓ 4 callers
Class
UserMemoryRAGAgent
Agent that uses RAG to answer questions about user conversation history
chapter3/contextual-retrieval-for-user-memory/agent.py:58
↓ 4 callers
Class
WebSearchAgent
Web Search Agent - 使用 Kimi API 的内置搜索工具 根据官方文档: https://platform.moonshot.ai/docs/guide/use-web-search Kimi 提供了内置的 $web_search 工具
chapter1/web-search-agent/agent.py:33
↓ 4 callers
Class
YFinanceMetadata
Metadata for Yahoo Finance operation results.
chapter4/perception-tools/src/yahoo_finance_tools.py:24
↓ 3 callers
Class
AgenticRAG
Agentic RAG system with ReAct pattern and multiple LLM provider support
chapter3/contextual-retrieval/agent.py:28
↓ 3 callers
Class
ChunkingConfig
Document chunking configuration
chapter3/contextual-retrieval/config.py:149
↓ 3 callers
Class
ChunkingConfig
Configuration for conversation chunking
chapter3/contextual-retrieval-for-user-memory/config.py:111
↓ 3 callers
Class
Community
Represents a community of related entities.
chapter3/structured-index/graphrag_indexer.py:49
↓ 3 callers
Class
ContextualKnowledgeBaseTools
Enhanced knowledge base tools with contextual retrieval support. Key Educational Points: 1. Dual Indexing: Maintains both contextual
chapter3/contextual-retrieval/contextual_tools.py:49
↓ 3 callers
Class
ConversationHistory
Manages conversation history with optional vector search
chapter3/user-memory/conversation_history.py:36
↓ 3 callers
Class
EvaluationResult
Result of evaluating an agent's response.
chapter3/user-memory-evaluation/models.py:74
↓ 3 callers
Class
ExitPlanModeTool
Use this tool when you are in plan mode and ready to code
chapter5/coding-agent/tools/exit_plan_mode_tool.py:9
↓ 3 callers
Class
GameExperience
Represents a single game interaction experience.
chapter1/learning-from-experience/llm_agent.py:16
↓ 3 callers
Class
IndexConfig
Configuration for RAG indexing
chapter3/contextual-retrieval-for-user-memory/config.py:122
↓ 3 callers
Class
IndexMode
Indexing modes for conversation chunks
chapter3/agentic-rag-for-user-memory/config.py:23
next →
1–100 of 570, ranked by callers