Portfolio Coder
Code Intelligence Platform built on the Portfolio RAG Ecosystem
Overview
Portfolio Coder is a code intelligence platform that provides:
- Repository Indexing - Scan and index code repositories with multi-language support
- Semantic Code Search - Find code by meaning, not just keywords
- Dependency Graphs - Visualize and query code dependencies
- AI-Powered Analysis - Code review, refactoring suggestions, and documentation generation
- Intelligent Agents - Tool-using agents for complex code tasks
Built on the Portfolio RAG Ecosystem, it leverages:
- portfolio_core - Hexagonal architecture foundation
- portfolio_index - Vector storage, LLM adapters, RAG strategies
- portfolio_manager - Generic intelligence orchestration layer
Features
Multi-Language Support
| Language | Parsing | Dependencies | Call Graph |
|---|---|---|---|
| Elixir | AST via Sourceror | mix.exs | Function calls |
| Python | Basic | requirements.txt | Imports |
| JavaScript/TypeScript | Basic | package.json | Imports |
Code Intelligence
- Semantic Search - Find code by natural language queries
- Symbol Navigation - Jump to definitions, find references
- Dependency Analysis - Identify circular dependencies, impact analysis
- Code Review - AI-assisted review with context from codebase
Installation
Add portfolio_coder to your dependencies:
def deps do
[
{:portfolio_coder, "~> 0.1.0"}
]
endQuick Start
1. Index a Repository
mix code.index /path/to/repo --index my_project2. Search Code
mix code.search "authentication middleware" --index my_project3. Ask Questions
mix code.ask "How does authentication work?" --index my_project4. Analyze Dependencies
mix code.deps build /path/to/repo --graph my_depsProgrammatic Usage
# Index a repository
{:ok, stats} = PortfolioCoder.index_repo("/path/to/repo",
index_id: "my_project",
languages: [:elixir, :python]
)
# Semantic code search
{:ok, results} = PortfolioCoder.search_code("database connection",
index_id: "my_project",
limit: 10
)
# Ask questions about the codebase
{:ok, answer} = PortfolioCoder.ask("How does caching work?",
index_id: "my_project"
)
# Build dependency graph
{:ok, graph} = PortfolioCoder.build_dependency_graph("deps", "/path/to/repo")Architecture
┌─────────────────────────────────────────────────────────────┐
│ portfolio_coder │
│ CLI | Indexer | Search | Graph | Tools | Parsers │
├─────────────────────────────────────────────────────────────┤
│ portfolio_manager │
│ Generic: RAG | Router | Agent | Pipeline │
├─────────────────────────────────────────────────────────────┤
│ portfolio_index │
│ Adapters: Pgvector | Neo4j | Gemini | Claude │
├─────────────────────────────────────────────────────────────┤
│ portfolio_core │
│ Foundation: Ports | Registry | Manifest | Telemetry │
└─────────────────────────────────────────────────────────────┘Development
git clone https://github.com/nshkrdotcom/portfolio_coder.git
cd portfolio_coder
mix deps.get
mix testLicense
MIT License - see LICENSE for details.