A tiny demo of automatic context management for LLMs. This is also a construction site for a new domain specific language for LLMs
- Git Repository Indexing: Index Git repositories for context-aware responses
- Passthrough Mode: Process natural language queries without complex AST compilation
- Visual Context Feedback: See which files are being used for context in your queries
- Multi-turn Conversations: Maintain conversation state between queries
- File Content Integration: Include relevant file contents in the AI's context
-
Install the requirements:
pip install anthropic pytest
-
Set your Anthropic API key:
export ANTHROPIC_API_KEY=your_api_key_here
Start the application:
python main.py/index REPO_PATH- Index a Git repository/help- Show help information/mode [standard|passthrough]- Set or view current mode/reset- Reset conversation state/verbose [on|off]- Toggle verbose mode/exit- Exit the program
# Index a repository
(passthrough) > /index ~/projects/my-repo
# Ask a question about the repository
(passthrough) > How does the file indexing work?
Thinking...
Files in context:
1. /home/user/projects/my-repo/memory/indexers/git_repository_indexer.py
2. /home/user/projects/my-repo/memory/memory_system.py
Response:
The file indexing process works by scanning the Git repository...
# Ask a follow-up question
(passthrough) > Can you tell me more about the GitRepositoryIndexer class?
Thinking...
Files in context:
1. /home/user/projects/my-repo/memory/indexers/git_repository_indexer.py
2. /home/user/projects/my-repo/tests/memory/indexers/test_git_repository_indexer.py
Response:
The GitRepositoryIndexer class is responsible for...
When you send a query, the system will:
- Show a "Thinking..." indicator while processing
- Display a list of files being used for context
- Show the AI's response based on those files
This helps you understand which files the system considers relevant to your query, making the system more transparent and helping you formulate better questions.
If no files are found relevant to your query, the system will explicitly tell you so.
For additional details about the system's operation:
(passthrough) > /verbose on
Verbose mode: on
(passthrough) > Tell me about the project structure
Thinking...
Files in context:
1. /home/user/projects/my-repo/README.md
2. /home/user/projects/my-repo/main.py
Response:
The project has a simple structure with...
Metadata:
subtask_id: subtask_1