Git Product home page Git Product logo

zep's Introduction

Zep Logo

Zep: A long-term memory store for LLM applications

Chat on Discord Twitter Follow PyPI - Downloads @getzep/zep-js build/test GoLangCI Lint

Quick Start | Documentation | LangChain Support | Discord
www.getzep.com

Easily add relevant documents, chat history memory & rich user data to your LLM app's prompts.

⭐️ Core Features

💬 Designed for building conversational LLM applications

  • Understands chat messages, roles, and user metadata, not just texts and embeddings.
  • Zep Memory and VectorStore implementations are shipped with your favorite frameworks: LangChain, LangChain.js, LlamaIndex, and more.

🔎 Vector Database with Hybrid Search

  • Populate your prompts with relevant documents and chat history.
  • Rich metadata and JSONPath query filters offer a powerful hybrid search over texts.

🔋 Batteries Included Embedding & Enrichment

  • Automatically embed texts and messages using state-of-the-art opeb source models, OpenAI, or bring your own vectors.
  • Enrichment of chat histories with summaries, named entities, token counts. Use these as search filters.
  • Associate your own metadata with sessions, documents & chat histories.

⚡️ Fast, low-latency APIs and stateless deployments

  • Zep’s local embedding models and async enrichment ensure a snappy user experience.
  • Storing documents and history in Zep and not in memory enables stateless deployment.

🛠️ Python & TypeScript/JS SDKs, Edge Deployment

  • Python & TypeScript/JS SDKs for easy integration with your LLM app.
  • TypeScript/JS SDK supports edge deployment.

Learn more

Examples

Hybrid similarity search with text input and JSONPath filters (TypeScript)

const query = "The celestial motions are nothing but a continual";
const searchResults = await collection.search({ text: query }, 3);

// Search for documents using both text and metadata
const metadataQuery = {
    where: { jsonpath: '$[*] ? (@.bar == "qux")' },
};

const newSearchResults = await collection.search(
    {
        text: query,
        metadata: metadataQuery,
    },
    3
);

Search search by embedding (Python)

# Search by embedding vector, rather than text query
# embedding is a list of floats
results = collection.search(
    embedding=embedding, limit=5
)

Persist Chat History to Zep (Python)

session_id = "2a2a2a" 

history = [
     { role: "human", content: "Who was Octavia Butler?" },
     {
        role: "ai",
        content:
           "Octavia Estelle Butler (June 22, 1947 – February 24, 2006) was an American" +
           " science fiction author.",
     },
     {
        role: "human",
        content: "Which books of hers were made into movies?",
        metadata={"foo": "bar"},
     }
]


 messages = [Message(role=m.role, content=m.content) for m in history]
 memory = Memory(messages=messages)
 result = await client.aadd_memory(session_id, memory)

Persist Chat History with LangChain.js (TypeScript)

const memory = new ZepMemory({
    sessionId,
    baseURL: zepApiURL,
    apiKey: zepApiKey,
});
const chain = new ConversationChain({ llm: model, memory });
const response = await chain.run(
    {
        input="What is the book's relevance to the challenges facing contemporary society?"
    },
);

Get Started

Install Server

Please see the Zep Quick Start Guide for important configuration information.

docker compose up

Looking for other deployment options?

Install SDK

Please see the Zep Develoment Guide for important beta information and usage instructions.

pip install zep-python

or

npm i @getzep/zep-js

zep's People

Contributors

danielchalef avatar rsharath avatar dependabot[bot] avatar sweep-ai[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.