Skip to main content

TypeAgent

Build powerful structured RAG applications with AI-powered knowledge extraction, incremental indexing, and natural language query processing.

Key Features

Structured RAG

AI-powered extraction of entities, topics, actions, and relationships from conversations

Dual Storage

Choose between in-memory or SQLite persistence with identical APIs

Multi-Index Architecture

Six specialized indexes for semantic search, temporal queries, and knowledge retrieval

Natural Language Queries

Ask questions in plain English and get accurate answers from your indexed data

Quick Start

Get up and running with TypeAgent in minutes.
1

Install TypeAgent

Install the package from PyPI using pip:
pip install typeagent
2

Set up environment

Configure your OpenAI API credentials:
export OPENAI_API_KEY=your-api-key
export OPENAI_MODEL=gpt-4o
3

Index your first conversation

Create a conversation and add messages with automatic indexing:
from typeagent import create_conversation
from typeagent.transcripts.transcript import TranscriptMessage, TranscriptMessageMeta

async def main():
    conversation = await create_conversation("demo.db", TranscriptMessage)
    
    message = TranscriptMessage(
        text_chunks=["We should build a Python library for Structured RAG."],
        metadata=TranscriptMessageMeta(speaker="Alice")
    )
    
    result = await conversation.add_messages_with_indexing([message])
    print(f"Indexed {result.messages_added} messages")
4

Query your data

Ask natural language questions:
answer = await conversation.query("What should we build?")
print(answer)  # "A Python library for Structured RAG."

Full Quickstart Guide

Follow our complete quickstart tutorial with working examples

Core Concepts

Understand the architecture and design principles behind TypeAgent.

Architecture Overview

Learn about the four-layer architecture and data flow

Knowledge Extraction

Understand how AI models extract structured knowledge

Indexing Strategy

Explore the six specialized indexes and their purposes

Structured RAG

Discover how structured knowledge improves retrieval quality

Integration Guides

Extend TypeAgent with email, podcasts, and custom data sources.

Email Integration

Ingest and query email conversations

Podcast Processing

Index podcast transcripts and metadata

Configuration

Customize extraction and indexing settings

API Reference

Explore the complete TypeAgent API.

create_conversation()

Factory function for creating conversation objects

ConversationBase

Core conversation class with query and indexing methods

Messages

Message types and metadata structures

Storage Providers

Memory and SQLite storage implementations

Community & Support

GitHub Repository

Star us on GitHub and contribute to the project

Report Issues

Found a bug? Let us know

Build docs developers (and LLMs) love