Skip to main content

A modern Python ADK - Agent Development Kit for building AI agents with LangGraph and LangChain. This library provides a comprehensive, type-safe framework for developing intelligent agents with chat, workflow, memory, and knowledge management capabilities.

Project description

AIGility ADK - Agent Development Kit

基于 LangGraph/LangChain 的智能体开发框架,提供开箱即用的 RAG、记忆管理、对话流等能力。

特性

  • RAG 检索增强生成

    • 基础 RAG 服务:文档摄取、向量化、语义检索
    • 工作流模式 RAG:基于 LangGraph 的可组合 RAG 工作流
    • 多 Embedding 支持:DashScope、HuggingFace、ZhipuAI 等
    • 多向量存储支持:Chroma、FAISS、Milvus、Qdrant 等
    • 太忆(TiMem)RAG 云服务集成(ChatFlow 工具调用)
  • 记忆管理

    • 持久化对话历史
    • 语义记忆检索
    • 可扩展的记忆存储(已集成 TiMem Memory Provider)
  • 对话流管理

    • 基于 LangGraph 的对话流编排
    • 工具调用支持
    • 状态管理
  • 工作流引擎

    • 可视化工作流构建
    • 节点编排
    • 条件分支和循环

安装

pip install aigility

快速开始

RAG 基础使用

from aigility.rag import RAGService, RAGConfig, EmbeddingConfig, VectorStoreConfig

# 配置 RAG 服务
config = RAGConfig(
    embedding=EmbeddingConfig(provider="dashscope", api_key="your-api-key"),
    vector_store=VectorStoreConfig(provider="chroma", persist_path="./my_db")
)

# 初始化服务
rag_service = RAGService(config=config)

# 添加文档
rag_service.add_file("document.pdf")

# 检索相关内容
results = rag_service.search("什么是机器学习?")
print(results)

RAG 工作流模式

from aigility.rag import RAGService, create_rag_workflow
from langchain_openai import ChatOpenAI

# 初始化 RAG 服务和 LLM
rag_service = RAGService()
llm = ChatOpenAI(model="gpt-4")

# 创建工作流
workflow = create_rag_workflow(rag_service, llm)

# 执行查询
result = workflow.invoke({
    "query": "什么是机器学习?",
    "messages": []
})

print(result["answer"])

客户端使用

from aigility import ADKClient, create_client

# 创建客户端
client = create_client(
    llm_provider="openai",
    llm_api_key="your-api-key",
    memory_api_key="your-memory-api-key",
)

# 使用记忆
memory = client.memory
await memory.add(
    messages=[{"role": "user", "content": "Hello"}],
    user_id="user123",
    character_id="assistant"
)

# 创建对话智能体
agent = client.create_chat_agent(name="my_agent")

文档

项目结构

aigility/
├── core/           # 核心配置和类型
├── memory/         # 记忆管理
├── chat/           # 基础对话
├── chatflow/       # 对话流管理
├── workflow/       # 工作流引擎
├── rag/            # RAG 检索增强生成
│   ├── service.py  # RAG 服务
│   ├── workflow.py # RAG 工作流
│   ├── client.py   # TiMem RAG 客户端
│   ├── embeddings/ # Embedding 模型
│   ├── vector_stores/ # 向量存储
│   └── ingestion.py # 文档摄取
├── adp/            # ADP 服务客户端
└── client.py       # 主客户端

技术栈

  • LangChain: 基础对话能力
  • LangGraph: 对话流和工作流编排
  • Chroma/FAISS/Milvus: 向量存储
  • DashScope/HuggingFace: Embedding 模型
  • Qdrant: 向量存储
  • TiMem: Memory/RAG 云服务

许可证

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aigility-0.0.4.tar.gz (58.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aigility-0.0.4-py3-none-any.whl (76.9 kB view details)

Uploaded Python 3

File details

Details for the file aigility-0.0.4.tar.gz.

File metadata

  • Download URL: aigility-0.0.4.tar.gz
  • Upload date:
  • Size: 58.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for aigility-0.0.4.tar.gz
Algorithm Hash digest
SHA256 72869633c395257c6db3d5b69a81aaf0ed55a44b3a47decb665ea40aebd4999c
MD5 c54faab0c8c4100cd1e2d45ab03cdbaa
BLAKE2b-256 b4842b56c498695c9be2411917441bbb32d8c6352f0fb93440da9c0b6e4b8f55

See more details on using hashes here.

File details

Details for the file aigility-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: aigility-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 76.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for aigility-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c6c93a0d55caf0c231ab682e6447fff629e434c8753c06befc55405a5fa96779
MD5 d1264e765e46507cf358f625a1aefdb0
BLAKE2b-256 386ab492b8b140060c3f9ee7c2c749547887f1c715621f876f007589698b9d3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page