
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Ragdaemon is a Retrieval-Augmented Generation (RAG) system for code. It runs a daemon (background process) to watch your active code, put it in a knowledge graph, and query the knowledge graph to (among other things) generate context for LLM completions.
Three ways to use Ragdaemon:
Ragdaemon powers the 'auto-context' feature in Mentat, a command-line coding assistant. You can install Mentat using pip install mentat
. Run with the --auto-context-tokens <amount>
or -a
(default=5000) flag, and ragdaemon-selected context will be added to all of your prompts.
Install locally to visualize and query the knowledge graph directly.
Install using pip install ragdaemon
, and run in your codebase's directory, e.g. ragdaemon
. This will start a Daemon on your codebase, and an interface at localhost:5001
. Options:
--chunk-extensions <ext>[..<ext>]
: Which file extensions to chunk. If not specified, defaults to the top 20 most common code file extensions.--chunk-model
: OpenAI's gpt-4-0215-preview
by default.--embeddings-model
: OpenAI's text-embedding-3-large
by default.--diff
: A git diff to include in the knowledge graph. By default, the active diff (if any) is included with each code feature.Ragdaemon is released open-source as a standalone RAG system. It includes a library of python classes to generate and query the knowledge graph. The graph itself is a NetworkX MultiDiGraph which saves/loads to a .json
file.
import asyncio
from pathlib import Path
from ragdaemon.daemon import Daemon
async def main():
cwd = Path.cwd()
daemon = Daemon(cwd)
await daemon.update()
results = daemon.search("javascript")
for result in results:
print(f"{result['distance']} | {result['id']}")
query = "How do I run the tests?"
context_builder = daemon.get_context(
query,
auto_tokens=5000
)
context = context_builder.render()
messages = [
{"role": "user", "content": query},
{"role": "user", "content": f"CODE CONTEXT\n{context}"}
]
print(messages)
asyncio.run(main())
FAQs
Generate and render a call graph for a Python project.
We found that ragdaemon demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.