A composable, resource-efficient framework for building AI applications locally in Rust. Inspired by langchain-rs
- 📚 Local Model Management: Advanced model lifecycle management with intelligent resource allocation
- 🔄 Composable Agents: Build complex AI workflows by chaining multiple agents together
- 💾 Vector Storage: Built-in support for efficient vector storage and similarity search using SQLite
- 🔍 Embeddings: Integrated text embedding capabilities using state-of-the-art models
- 🛠 Flexible Tools: Built-in tools for web scraping, search, and command execution
- 🌐 Web Interface: Clean HTTP interface for model management and inference
- 🧠 Memory Efficient: Smart memory management for running multiple models
pyano-framework/
├── agent/ # Agent implementations and traits
├── chain/ # Sequential chain execution
├── embedding/ # Text embedding capabilities
├── llm/ # LLM interface and processing
├── model/ # Model management and server
├── tools/ # Utility tools (scraping, search)
├── vectorstore/ # Vector storage implementations
└── schemas/ # Common data structures
- Run setup.sh
chmod +x setup.sh
./setup.sh- Install required system dependencies:
# Install SQLite vector extension
# Download from https://github.com/asg017/sqlite-vec- Run example
cargo run --example Research_Questionaire --features=sqlxuse pyano::{
agent::agent_builder::AgentBuilder,
chain::sequential_chain::Chain,
ModelManager,
};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize the model manager
let model_manager = Arc::new(ModelManager::new());
// Create agents for your workflow
let agent_1 = Arc::new(Mutex::new(
AgentBuilder::new()
.with_name("Content Generator")
.with_system_prompt("You are a content generator.")
.with_user_prompt("Generate content about AI.")
.with_stream(true)
.build()
));
// Create and run a chain
let mut chain = Chain::new()
.add_agent(agent_1);
chain.run().await?;
Ok(())
}use edge-framework::{
vectorstore::sqlite_vec::StoreBuilder,
embedding::embedding_models::{EmbeddingModels, TextEmbeddingModels},
};
// Initialize vector store
let store = StoreBuilder::new()
.embedder(embedder)
.db_name("my_app")
.table("documents")
.build()
.await?;
// Add documents and search
store.add_documents(&documents, &VecStoreOptions::default()).await?;
let results = store.similarity_search("query", 5, &options).await?;// Start model manager server
let manager = Arc::new(ModelManager::new());
let server = ModelManagerServer::new(manager);
server.run("127.0.0.1:8090").await?;
// Connect client
let client = ModelManagerClient::new("http://127.0.0.1:8090");it includes several built-in tools:
- Web Scraper: Extract content from websites
- DuckDuckGo Search: Perform web searches
- Command Executor: Execute system commands
- Vector Store: Store and query vector embeddings
We welcome contributions! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Rust 🦀
- Uses SQLite and sqlite-vec for vector storage
- Inspired by various AI frameworks and tools
For detailed documentation and examples, check out:
/docsdirectory for usage examples/examplesdirectory for sample applications- Code documentation with
cargo doc --open
- Support for more model types
- Support for OpenAI, Anthropic, Together and other Centralised AI providers
- Enhanced memory management
- Additional vector store backends including Chroma, LanceDB
- More built-in tools and agents
- Improved documentation and examples
Built with ❤️ using Rust