A CLI tool that helps AI assistants understand projects through persistent documentation and RAG search
Project description
devco
A CLI tool that helps AI assistants understand projects by managing persistent documentation, principles, and context through embeddings and RAG querying.
🎯 Problem
AI assistants lose context when working on projects across sessions. They waste time re-exploring codebases, re-learning project structure, and rediscovering development practices with every new conversation.
✨ Solution
devco creates persistent, searchable project knowledge that survives context resets:
- Development Principles - Your team's coding standards and practices
- Project Summary - High-level project description and purpose
- Technical Sections - Detailed implementation guides with function names, file paths, and examples
- RAG Search - Semantic search across all documentation using vector embeddings
🚀 Quick Start
Installation
pip install devco
Initialize in your project
devco init
Add your development principles
devco principles add --text "Follow Test-Driven Development"
devco principles add --text "Keep functions under 20 lines"
Document your project
devco summary replace --text "FastAPI web service for user authentication with PostgreSQL backend"
devco section add architecture \
--summary "Clean architecture with dependency injection" \
--detail "Entry point: main.py:create_app() line 15. Uses FastAPI with dependency injection via Depends(). Database models in models/ directory. Business logic in services/ with UserService.create_user() method."
Generate embeddings for semantic search
devco embed
Query your documentation
devco query "how does authentication work"
devco query "testing approach"
devco query "database schema"
📚 Full Documentation
View all content
devco summary # Show project summary and all sections
devco principles # List development principles
devco section show testing # Show specific section
Manage principles
devco principles # List all
devco principles add --text "New principle" # Add with flag
devco principles add # Add interactively
devco principles rm 2 # Remove by number
devco principles clear # Remove all
Manage summary
devco summary # Show current
devco summary replace --text "New summary" # Replace with flag
devco summary replace # Replace interactively
Manage sections
devco section show architecture # Show specific section
devco section add testing \
--summary "TDD with pytest" \
--detail "Tests in tests/ directory. Run: pytest -v"
devco section replace api --summary "..." --detail "..."
devco section rm outdated-section
Search and embeddings
devco embed # Generate embeddings for all content
devco query "database setup" # Semantic search
devco query "testing framework"
🏗️ Why This Works
For AI Assistants
Instead of this inefficient pattern:
AI: Let me search through your files to understand the project...
AI: *uses grep, find, reads multiple files*
AI: *tries to infer patterns and practices*
AI: OK, I think I understand how this works...
You get this efficient pattern:
AI: devco query "testing approach"
AI: Perfect! I can see you use pytest with TDD methodology,
tests are in tests/ directory, and I should follow the
pattern in tests/test_user.py:test_create_user() line 25.
For Development Teams
- Onboarding: New developers get instant project context
- Consistency: Shared principles ensure consistent code
- Documentation: Implementation details with specific examples
- Knowledge Retention: Project knowledge survives team changes
🔧 Technical Details
Architecture
- CLI Framework: argparse with subcommands
- Storage: JSON files + SQLite for vector embeddings
- Embeddings: Gemini via
llmpackage for consistent results - Search: Cosine similarity with chunked content and overlap
File Structure
.devco/
├── config.json # Settings and embedding model
├── principles.json # Development principles
├── summary.json # Project summary and sections
├── devco.db # SQLite database with embeddings
└── .env # API keys (git-ignored)
Requirements
- Python 3.8+
llmpackage with Gemini plugin- Google API key for embeddings
⚙️ Configuration
Set up embeddings
- Install the llm package:
pip install llm llm-gemini - Add your Google API key to
.devco/.env:GOOGLE_API_KEY=your_key_here - Generate embeddings:
devco embed
Embedding Models
Configure in .devco/config.json:
{
"embedding_model": "gemini-embedding-exp-03-07-2048",
"chunk_size": 500,
"chunk_overlap": 50
}
📖 Best Practices
Documentation Content
✅ Include specific details:
- Function names:
UserService.authenticate() - File paths:
src/auth/service.py:45 - Command examples:
pytest tests/test_auth.py -v - Code snippets and patterns
✅ Write for AI assistants:
- Assume no prior context
- Include implementation details
- Specify exact locations and examples
❌ Avoid vague descriptions:
- "We use good practices" → Specify what practices
- "Tests are important" → Specify testing framework and patterns
- "Code is modular" → Specify module structure and key classes
Principles
Good principles are specific and actionable:
- ✅ "Use pytest fixtures for database setup in tests/conftest.py"
- ✅ "API endpoints follow REST patterns with serializers in api/serializers.py"
- ❌ "Write good code"
- ❌ "Be consistent"
🤝 Contributing
- Fork the repository
- Create a feature branch
- Follow TDD: write tests first
- Ensure all tests pass:
pytest -v - Update documentation with specific implementation details
- Submit a pull request
📄 License
MIT License - see LICENSE file for details.
🔗 Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file devco-0.1.6.tar.gz.
File metadata
- Download URL: devco-0.1.6.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a443406fa6c4cd092c03163348cdb8f4f8930a14623e33cef923dca4e73c2f95
|
|
| MD5 |
9fc2e6da0e48616cb695897603c5200a
|
|
| BLAKE2b-256 |
68f65b5cd24b27c5223c1114a5f633feee3cd0c1600c4ee5d1bfe0fb919b7251
|
File details
Details for the file devco-0.1.6-py3-none-any.whl.
File metadata
- Download URL: devco-0.1.6-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ec9bc4fc1ed973153ceabe0fd9ffd4b65433ba7419602658dba3fae53fe8a64
|
|
| MD5 |
d488922959215e57de04a6f0e4b8f521
|
|
| BLAKE2b-256 |
bec11bc122f6bf0773a7ebc700dfc406e8f69af5104cf6fc69b6783397a5fa33
|