Use this file to discover all available pages before exploring further.
Integrate Memvid with Microsoft AutoGen to build multi-agent systems with persistent knowledge retrieval. The autogen adapter provides function schemas compatible with OpenAI’s function calling API.
import { use } from '@memvid/sdk';// Open with AutoGen adapterconst mem = await use('autogen', 'knowledge.mv2');// Access function schemas (OpenAI-compatible)const functions = mem.functions;
Node.js uses OpenAI function calling directly. The AutoGen framework is Python-only,
but the function schemas work with any OpenAI-compatible client.
from memvid_sdk import create, useimport os# Create new file or open existingif os.path.exists('knowledge.mv2'): mem = use('autogen', 'knowledge.mv2')else: mem = create('knowledge.mv2', kind='autogen')# Access AutoGen toolstools = mem.tools # Returns AutoGen function definitions
from autogen_agentchat.agents import AssistantAgent, UserProxyAgentfrom memvid_sdk import create, useimport os# Create new file or open existingif os.path.exists('knowledge.mv2'): mem = use('autogen', 'knowledge.mv2', read_only=True)else: mem = create('knowledge.mv2', kind='autogen')# Get the search tool (find tool is at index 1)find_tool = mem.tools[1]# Create a wrapper function for the searchdef search_knowledge(query: str) -> str: results = mem.find(query, k=5) return "\n".join([f"- {r.get('title')}: {r.get('text', '')[:200]}" for r in results])# Create assistant with Memvid knowledgeassistant = AssistantAgent( name="assistant", llm_config={ "model": "gpt-4o", "functions": [find_tool.schema] }, system_message="You have access to a knowledge base. Use search_knowledge to find information.")# Register the functionassistant.register_function( function_map={find_tool.name: search_knowledge})# Start conversationuser_proxy = UserProxyAgent(name="user", human_input_mode="NEVER")user_proxy.initiate_chat( assistant, message="Find information about authentication and summarize it")
from memvid_sdk import usemem = use('autogen', 'knowledge.mv2', read_only=True)# Create custom search function with specific optionsdef search_docs(query: str, limit: int = 5) -> str: """Search documentation with custom parameters.""" results = mem.find(query, k=limit, scope='mv2://docs/') return "\n".join([f"- {r.title}: {r.snippet}" for r in results])def search_recent(query: str) -> str: """Search recent entries only.""" results = mem.find(query, k=5) # Filter by recency using timeline recent_ids = {e.frame_id for e in mem.timeline(limit=100)} return "\n".join([ f"- {r.title}: {r.snippet}" for r in results if r.frame_id in recent_ids ])