Skip to content

lishenxydlgzs/aki

Repository files navigation

Aki

Aki is a highly customizable AI assistant that adapts to your unique workflow.

Features

Aki provides a rich set of features designed to enhance AI assistant capabilities:

AI Assistant Profiles

  • Aki: General-purpose AI assistant for SDEs - handles all tasks with full access to tools
  • Akira: Research-focused assistant specialized in information retrieval and analysis
  • Akisa: Software engineering assistant focused on coding tasks and development workflows

LLM Integration

  • Bedrock: Seamless integration with Bedrock models
  • Ollama: Support for running local models via Ollama
  • Customizable providers: Extensible architecture for adding new LLM providers

Toolsets

  • Web Search Tool: Easily integrate web search capabilities using DuckDuckGo or Google Serper API
  • Code Analyzer: Parse and understand repository structure with language-specific analysis
  • Process Manager: Control long-running processes and services with monitoring capabilities
  • Task Management: Create and track multi-step tasks with status tracking
  • File Operations: Comprehensive file management with security constraints
  • Python Execution: Execute Python code snippets directly in conversations
  • Shell Commands: Run system commands from within the assistant interface
  • Batch Tool: Combine multiple tool operations efficiently
  • HTML Rendering: Display rich content and interactive elements

Database System

  • SQLite: Default lightweight database for storing conversations and state
  • PostgreSQL: Optional robust database for production environments

Architecture

  • LangGraph: Built on LangGraph for powerful agent workflows
  • MCP Integration: Model Context Protocol support for external system connections
  • Chainlit UI: Modern, responsive chat interface

Getting started

Aki can be installed using various Python package managers. We recommend using uv for its speed and reliability.

Install uv

curl -LsSf https://astral.sh/uv/install.sh | sh

or follow official instructions

Install pnpm

This is required to build chainlit from source

curl -fsSL https://get.pnpm.io/install.sh | sh -

or follow official instructions

Using uv

# Install from the project directory
uv tool install --python 3.12 git+https://github.com/Aki-community/aki.git@main

Run aki

aki

Configuration

LLM Configuration

Bedrock

To use Bedrock, set the following environment variables: create a AWS profile named aki with permission to access models.

Ollama

To use Ollama, ensure the Ollama service is running locally. Aki will automatically detect supported models.

Google Serper API

To use Google Serper API (offers better search results), set the SERPER_API_KEY environment variable:

export SERPER_API_KEY="your-api-key"

If the API key is not available, the tool automatically falls back to using DuckDuckGo search.

Development

Project Structure

Aki is organized into several key modules:

aki/
├── app.py                # Main application entry point
├── config/               # Configuration management
├── chat/                 # Chat system components
│   ├── base/             # Base profile classes
│   ├── graph/            # LangGraph agent definitions
│   └── implementations/  # Specific agent implementations
├── llm/                  # LLM provider integration
│   └── providers/        # LLM provider implementations
├── persistence/          # Database and state management
├── profiles/             # AI assistant profile definitions
│   └── prompts/          # System prompts for profiles
├── public/               # UI assets and components
└── tools/                # Tool implementations
    ├── code_analyzer/    # Code analysis tools
    ├── file_management/  # File operation tools
    └── mcp/              # MCP integration

Setting Up Development Environment

# Clone the repository
git clone https://github.com/Aki-community/aki.git
cd aki

# Create a virtual environment
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Sync dependency
uv sync

# Run aki
uv run aki

Install additional dependences for developers (test/lint)

uv sync --extra dev

Add new dependencies

uv add new-dependency-name

Creating Custom Profiles

You can create custom AI assistant profiles by adding JSON configuration files to the profiles directory:

{
  "name": "Your Assistant Name",
  "description": "Description of your assistant",
  "system_prompt_file": "prompts/your_prompt.txt",
  "tools": [
    "file_management_readonly",
    "web_search",
    "code_analyzer",
    "tasklist"
  ],
  "default_model": "(bedrock)anthropic.claude-3-sonnet-20240229-v1:0",
  "reasoning_config": {
    "default_enabled": true,
    "budget_tokens": 2048
  }
}

Build Script

Aki provides a comprehensive build script that runs formatting, testing, and building in a single command:

# Run the complete build process (format, test, coverage, build)
hatch run release

This command:

  1. Runs code formatting with black
  2. Executes all tests with coverage tracking
  3. Generates coverage reports (terminal and HTML)
  4. Builds the package using hatch

Running Tests

Aki uses pytest for testing. Run the tests with:

# Run all tests
pytest

# Run with verbose output
pytest -v

# Run specific test file
pytest tests/test_app.py

# Run tests with coverage report
coverage run -m pytest

Contributing

Contributions are welcome! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run the tests to ensure they pass (pytest)
  5. Commit your changes (git commit -m 'Add some amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Code Style

We follow PEP 8 guidelines for Python code. You can use tools like flake8 and black to ensure your code meets these standards:

# Install code quality tools
uv pip install flake8 black

# Check code style
flake8 src tests

# Format code
black src tests

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages